How do I find orphaned computer objects in Active Directory using PowerShell?

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

How can I find all computer accounts in my Active Directory domain that have been inactive for x days using PowerShell?

This would give you all computer accounts that have no activity for the last 365 Days.

Search-ADAccount -AccountInactive -ComputersOnly -TimeSpan 365.00:00:00

This would sort it for you by lastlogondate.

Search-ADAccount -AccountInactive -ComputersOnly -TimeSpan 365.00:00:00 | Sort-Object lastlogondate | Ft name,lastlogondate -auto

This would give you disabled computer accounts.

Search-ADAccount -AccountDisabled -ComputersOnly 

Recovering accidentally deleted Items in Active Directory

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Well, it could happen that you delete an Active Directory Objects / Accounts (like a User, Group, Computer whatever object) accidentally. In the past i used ADSIEdit.msc to restore the object. Well, this is a not so straight-forward procedure and not that easy to accomplish. Lately I’ve stumbled over a page from guy/blog called Windowmaker  Logo_ActiveDirectory

Continue reading

PowerShell: Get SID from AD (Active Directory) User / Group using PowerShell

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

To get the SID of an AD Object (User, Group, whatever) quickly, i recommend using PowerShell.
When trying to get the SID using ADUC (Active Directory User and Computer Snap-in), you can not copy/paste the SID as a string since it is stored in a binary format.

Continue reading

Active Directory, List FSMO Roles of a Domain Controller (DC) using NtdsUtil.exe

To list the FSMO (Flexible Single Master Operations) Roles of a Microsoft Active Directory Domain Controller (DC) using NtdsUtil.exe:

Start a command prompt (cmd.exe)

Start NtdsUtil.exe
C:\>NtdsUtil.exe
Switch to Roles context
ntdsutil:Roles
Swtich to Connections context
fsmo maintenance:Connections Continue reading