Powershell to get the Home Directory Path

If we wanted to find Home Directory Path of the users in the Orginization then below commands helps you to pull the data

Get-QADUser | select DisplayName,Email,HomeDirectory | Export-Csv c:\HomeDirectory.csv

Command to get the Home Directory for the given list of users and export the result to CSV

get-content C:\users.txt | select DisplayName,Email,HomeDirectory | Export-Csv c:\HomeDirectory.csv

 

 

Recovering Deleted User Ad account throught Active Directory powershell

We can recover any Active Directory deleted object with in the Tombstone period.
Tombstone lifetime can be found in active directory using below steps

• Load the ADSIEdit snap-in by navigating to start menu, programs, Windows 2000 Support Tools, Tools, ADSI Edit, or simply type adsiedit.msc at the run command.
• Navigate down to CN=Directory Service, through Configuration, CN=Configuration,DC=domainName,DC=com, CN=Services, CN=Windows NT, right-click and choose properties. 
• scroll down to tombstoneLifetime. This will have Tombstone period

Get-QADUser -Tombstone

Will get the list of user accounts which are Deleted and residing in Tombstone

  

Get-QADUser -Tombstone <name> |restore-QADDeletedObject

Will restore the user object in to the OU LOSTANDFOUND

  

Get-QADUser -Tombstone -LastKnownParent ‘<DN of container>’
Restores all user accounts that were deleted from a particular container to OU LOSTANDFOUND.

 

 Get-QADUser –Tombstone –LastChangedOn (get-date -year 2008 -month 9 -day 1)

Restores all user accounts that were deleted on September 1, 2008

 

Get-QADUser –Tombstone  <username> | fl

Gives the complete details of the -Tombstone account which can help in finding detained information of the Tombstoned account

Activeroles Quest Management Powershell to check User account Active or Disabled

You can download Active roles Quest Management shell from the below mentioned link.

http://www.quest.com/powershell/activeroles-server.aspx

Commands to check if mailbox is active or disabled

Get-QADUser <username> -enabled              

Will get the result if acount in active

Get-QADUser <username> -disabled                

Will get result if account is disabled

Get-QADUser  -Enabled       

Will get  all the enabled in the Active Directory

Get-QADUser  -Disabled      

Will get all the disabled users in the Active Directory

get-content “C:\users.txt” | Get-QADUser -enabled | select Email 

Will get list of all active users email address from the given input users