posts-powershell

Use Get-CimInstance with DCOM

PowerShell 3.0 added an alternative to Get-WmiObject: Get-CimInstance seems to work very similar and can retrieve information from the internal WMI...

Encoding Pictures

If your script needs resources such as icons or pictures, you do not have to ship these resources separately. They can be Base64-encoded and added...

Managing Windows Firewall

Beginning in Windows 8 and Server 2012, there is a cmdlet that helps you enable the client firewall for various profiles: Set-NetFirewallProfile...

Finding Recursive AD Memberships

In AD, there is a strange-looking filter: 1.2.840.113556.1.4.1941. It is called "matching rule in chain" and can be used to quickly find...

Clearing Recycle Bin

Before the advent of PowerShell 5.0, to clear the recycler, you would have to manually delete the content of the hidden $Recycle.Bin folder in the...

Force User to Change Password

Use this code snippet to force a user to change his/her password: #requires -Version 1 -Modules ActiveDirectory Set-ADUser -Identity username...

Get List of Operating Systems

If your boss needs a list of operating systems used by computers in your AD, this may be a good start: #requires -Version 1 -Modules ActiveDirectory...

1 95 96 97 98 99 237