Useful PowerShell commands

Basic powershell commands:

Create new User:

 new-aduser (name User) -path (details server and OU/CN)

Create new Ou:

New-ADorganizationalUnit (Name Ou)

Create a new computer: 

 New-ADcomputer (name)

Export information to CSV:

 get-aduser -Filter * -properties * | export-csv path (where)

Create group:

new-adgroup (Name) -GroupScope (Type Group)

Move User: 

get-ADuser -identity (name user) | move-ADobject -targetPath “cn=Users,dc=(domain name)”

Export spcify attributes From Active Directory ;

 get-ADuser -serachbase (“path”) -filter * -properties * | select (which attributis ) -export.csv

How to move object in Active Directory :

 move-adobject -identity (path of object) for example “cn=netsystem1,cn=Users,dc=netsystem,dc=org,dc=il -targetpath (where to move “ou=HR,dc=netsystem,dc=org,dc=il”

Powershell Exchange:

Get information about mailbox.:

Get-mailbox (user)

Show accepted Domain:

show Accepteddomain

Export PST exchange 2010:

 New-mailboxexportrequest -mailbox “name of User” -Filepath :(where?).pst

Export PST exchange 2007:

 Export-mailbox (UserName) -Path (where).pst