This post explains how we can use ADSI and FromFileTime to convert datetime attributes in Active Directory to a human-readable date and time. You’ll notice when you return attributes such as lastlogon, lastlogontimestamp and lastpwdset that the format of the … Continue reading →
This post includes an example of how we can use ADSI to list nested members of an AD group. In other words, if the group contains nested groups, it will iteratively search all the members of those nested groups too. … Continue reading →
This post provides a simple example of how we can use PowerShell ADSI to modify an AD group. In this example, we modify the description attribute of an AD group. You can also use ADSI to clear the attributes for … Continue reading →
This post provides a simple example of how we can use PowerShell ADSI to create an AD group. $adGroupType = @{ Global = 0x00000002 DomainLocal = 0x00000004 Universal = 0x00000008 Security = 0x80000000 } #OU containing the AD group $adGroupOU=”OU=Application,OU=Groups,DC=alkanesolutions,DC=co,DC=uk” … Continue reading →
This post provides a simple example of how we can use PowerShell ADSI to delete an AD group. #OU containing the AD group $adGroupOU=”OU=Application,OU=Groups,DC=alkanesolutions,DC=co,DC=uk” #AD group name $addADGroup = “CN=alkane_ad_group” #Full distinguished name of AD group $distinguishedName = “$addADGroup,$adGroupOU” #check … Continue reading →
This post will examine the difference between PowerShell ADSI and ADSISearcher when using PowerShell to query Active Directory. ADSI and ADSISearcher are used to query Active Directory (AD) using Lightweight Directory Access Protocol (LDAP). What is LDAP? LDAP, as the … Continue reading →
UPDATE: I’ve updated this script because LDAP does not return all Active Directory group members if there are more than 1500 members in the group. This post provides a function which enables us to use PowerShell ADSI to migrate AD … Continue reading →
This post provides an example of creating a pretty PowerShell combobox using a custom DrawMode. Instead of using the default fonts and colours, we can override this setting to conditionally highlight combobox entries in different colours, and even use an … Continue reading →
This post provides an example of how we can override the default behaviour to show custom tooltips in PowerShell Forms using OwnerDraw. Add-Type -AssemblyName System.Drawing #define brushes for black and white $whiteBrush = new-object Drawing.SolidBrush White $blackBrush = new-object Drawing.SolidBrush … Continue reading →
This is a simple PowerShell script that can be used to trigger SCCM client actions remotely using PowerShell. It only currently supports three client actions for simplicity’s sake (MachinePolicy, DiscoveryData, SoftwareInventory) but you can add more as specified here. Usage … Continue reading →