How to add user accounts to a membership of an Active Directory Group.
Users in File: C:\edv\bbuser.csv
Active Directory Group: SG_Blackberry_User_2010
Users: m.butsch and assistant
(First LINE has to be UserName an not a user)
Import-module ActiveDirectory
Import-CSV “C:\edv\bbUser.csv” | % { Add-ADGroupMember -Identity SG_Blackberry_User_2010 -Member $_.UserName }
——————————————————————————
List all NON Expire accounts in a certian OU:
Import-Module ActiveDirectory
Get-ADUser -SearchScope Subtree -SearchBase “OU=Active,OU=Users_W7,OU=GZF,DC=customer,DC=ch” -Filter {PasswordNeverExpires -eq $true} -Properties PasswordNeverExpires | Select-Object Name,ObjectClass, UserPrincipalName | Sort-Object Objectclass