Category Archives: Windows Administration

Get Resultant Set of Polices (RSOP) with User Selection

The Get-GPResultantSetOfPolicy cmdlet in the GroupPolicy module of PowerShell has a parameter for a user name.  Often I have no idea who has logged onto the computer.  Get-RSOP.ps1 uses WMI to give you a pick list of users on the … Continue reading

Posted in Active Directory, Group Policy Objects, PowerShell, Scripting, Windows Administration | Tagged , | Leave a comment

Remove Active Directory Delegations

Over time, Active Directory delegations tend to accumulate and drift from the standards in the enterprise.  Removing the delegations for a user or group can be slow, especially if you do it manually.  Microsoft has a good article about this process, but … Continue reading

Posted in Active Directory, Alan's Favorites, Functions, My Best, PowerShell, Scripting, Security, Windows Administration | Tagged , , , | Leave a comment

Get Downtime Using PowerShell

I have been having problem with a computer with random reboots, and hanging on restart.  I wanted to know how long the computer had been unavailable.   I decided to use System Event ID 12 as the startup event for the … Continue reading

Posted in Computing, Functions, PowerShell, Scripting, Windows Administration | Leave a comment

Fix User’s Home Directory Permissions with Take Ownership

Fix-HomeDrivePerms.ps1 is a PowerShell script which attempts to reset folder security when the permissions are really hosed.  It uses a take ownership function, Set-Owner, by Boe Prox, instead of takeown.exe, but does shell out to iCacls.exe.  I wrote this to … Continue reading

Posted in PowerShell, Scripting, Scriptlets, Security, Windows Administration | Tagged , | Leave a comment

Another User Folder Security Reset Script

This simple batch file resets the inheritance on users folders and then grants them “modify” using the builtin icacls.exe.   This script does not address issues which require you to take ownership — I will post one that does that soon. … Continue reading

Posted in Batch, Scripting, Security, Windows Administration | Tagged , , | Leave a comment

Set Share Folder Icon for Server 2012 and Windows 10

I like to look at a folder and know whether or not it is shared. In earlier Windows OS there was a hand overlay which shows you this information. In Server 2012, this indicator has been omitted. Set-SharedFolderIcons.ps1 lets you … Continue reading

Posted in PowerShell, Scripting, Windows 10, Windows Administration | Tagged , | Leave a comment

Get the NetBIOS AD Domain Name from the FQDN

I hate using NameTranslate, because it is a COM object, and because the output is often really hard to get into a clean, trimmed string.  The netBIOS name isn’t a part of the AD domain object, but I suspected that the … Continue reading

Posted in Active Directory, Functions, PowerShell, Scriptlets, Windows Administration | Tagged , , | Leave a comment

Test Replication – A PowerShell Wrapper for RepAdmin

Repadmin is a standard tool in an AD admin’s toolbox, and “showrepl” displays the status of replication in your domain. The results of this command are quite verbose, and can make your eyes glaze over in late night troubleshooting.  A … Continue reading

Posted in Active Directory, PowerShell, Scripting, Windows Administration | Tagged , , | Leave a comment

Remove DNS Host Record and PTR with PowerShell

You have been asked, “Please remove the host record for these 15 computers, plus their associated PTR records”.  It isn’t a difficult task, but it can be time consuming, especially if you have a large DNS database.  The in-addr.arpa bit … Continue reading

Posted in Active Directory, Windows Administration | Tagged , , | Leave a comment

Who Added this User to the Domain?

On of the questions that I am frequently asked is “who created that user”.  In a small shop, the answer should be “me”.  But in a really large environment the answer may not be quite so clear. When an object … Continue reading

Posted in Active Directory, PowerShell, Scripting, Security, Windows Administration | Leave a comment