Activedirectory

When you want to use powershell together with Active Directory you should look into the Quest AD Powershell Snapins. They are great cmdlet that will take the burden out of you AD work.
In my profile I have the following line so that it will import all modules:

get-module -listAvailable | import-module

To add a group to a local administrators group on a server you would type
new-localgroupmember -computer servername -Member 'domain\groupname' -group "administrators"

To view the members of a local group of a domain server you would type:
Get-LocalGroupMember -groupname administrators -computername servername -DomainAccountsOnly

On me

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License