Update Group Membership without logging off or rebooting

For user membership

klist purge

For computer membership, use elevated prompt

klist -li 0:0x3e7 purge

 

Advertisements

Export AD email information

Used for pre-staging users to migrate to another forest

Get-ADUser -Filter * -Properties * | Select-Object samaccountname,displayname,givenname,sn,mail,@{L=”proxyaddresses”;E={$_.proxyaddresses -join “;”}} | Export-Csv c:\temp\users.csv -NoTypeInformation

Using PowerShell to retrieve workstations and/or servers from AD

Servers

Get-ADComputer -Filter {OperatingSystem -Like “*server*”} -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack -Wrap -Auto

Workstations

Get-ADComputer -Filter {OperatingSystem -NotLike “*server*”} -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack -Wrap -Auto

Both

Get-ADComputer -Filter * -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack -Wrap -Auto

Inventorying Computers with AD PowerShell