Thursday, September 21, 2017

Powershell: Add Members from multiple Groups to a specified Group

The following script can be used with a filter or you specify the groups in the AdminGroups.txt.

I added a member removal task to this script to only host members that are members of the defined group. You can remove this line if you don´t need this.

Download:
https://gallery.technet.microsoft.com/Add-Members-from-multiple-6cbcae53


Tuesday, September 12, 2017

Powershell Remove spaces from the end of lines in a text file

Use this two lines and define your old and new file.

$file = Get-Content "C:\admin\OldFile.txt"
$file | Foreach {$_.TrimEnd()} | Set-Content "C:\admin\NewFile.txt"