Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Author: Alan

See https://www.akaplan.com/about/

Getting the Status of a GPO Deployment in an AD Forest

Posted on October 2, 2020 by Alan

If you are in a large environment, you may be deploying group policies to multiple domains.  How can you track the deployment status of the deployment? With Get-GPOdeploymentStatus.ps1, you can enter the name of the GPO, then have all domains queried to discover if it has been installed, who installed it, when it was last…

Read more

Get Security Set on AD Object

Posted on October 2, 2020October 2, 2020 by Alan

It’s been a while, gentle reader, since my last post. It isn’t that I haven’t been writing code, but rather that much of what I write is for internal use only. Recently I was asked to write a PowerShell script to show the advanced security for any AD object, without relying on the ActiveDirectory module….

Read more

A Fast Secure Password Generator

Posted on April 12, 2020 by Alan

This PowerShell one-line generates a reasonably secure password from the characters in the system’s Path. Here I am replacing the space character with the tilde ~ for additional complexity. Get-Enumerator returns each character of the path individually.   You can set the password length as the value for the count parameter. $pw = [array](($env:Path).Replace(‘ ‘,’~’).getenumerator() |…

Read more

Get Active Directory Forest Domain Controllers

Posted on January 25, 2020 by Alan

Like the other script posted today, this was written to help out the networking team with a simple inventory of DCs in a large Active Directory forest.  It queries all domains in the forest, creating a CSV file with the Domain, DC name, IP Address, OS, AD Site and Roles.  It can optionally ping the…

Read more

Get Sites and Subnets in AD Forest

Posted on January 25, 2020 by Alan

The script below was written so the networking staff would be able to always have a current list of the AD Sites and Subnets, without relying on the Active Directory Module. <# Get-ADSubnets.ps1 Alan Kaplan 1/24/20 Get list of AD Subnets in Forest Does not rely on AD module or admin rights #> #Default logfile…

Read more

Tips for Implementing Group Managed Service Accounts in an AD Forest

Posted on July 27, 2019July 27, 2019 by Alan

TLDR: Group Managed Service Accounts (gMSAs) are limited to the domain in which they are created. gMSAs are not reported by Get-ADUser. Managed Service Accounts (MSAs) were introduced in Server 2008 R2 to allow for system managed password changes of service accounts. Group Managed Service Accounts were introduced in Server 2012 as an improvement to…

Read more

PowerShell and Process Owners

Posted on February 28, 2019 by Alan

If you are running as an administrator, it is easy to get the owner associated with a process using PowerShell: Get-Process -IncludeUserName. Get-Process gets information from System.Diagnostics.Process, not WMI. But you can get similar information from WMI, even if you aren’t an administrator. We had a little debate about this in our last Charlotte PowerShell…

Read more

Get WMI Namespaces with PowerShell

Posted on February 28, 2019 by Alan

Here is a quick way to get a list of WMI namespaces on a computer using PowerShell.  Notice that this requires that you run it as an administrator. #Requires -RunAsAdministrator Function Get-WMINamespaceEnum ($NS) { Write-Output $ns Get-CimInstance “__Namespace” -Namespace $NS -ErrorAction SilentlyContinue | ForEach-Object { Get-WMINamespaceEnum “$ns\$($_.name)” } } #Example Get-WMINamespaceEnum ‘root’ | Sort-Object The…

Read more

Two Column WPF Form to Select Items or Properties

Posted on January 6, 2019September 12, 2020 by Alan

Many of my scripts are written for other people to do Active Directory reporting.  One of my goals in supporting them is to give them as much flexibility in the data returned with the minimum amount of custom coding required.   Convert-ADValues (which I will update soon), outputs friendly dates and expanded information for certificates,…

Read more

Find the AD Site from an IP Address

Posted on December 2, 2018June 16, 2019 by Alan

“What AD site is this IP address in?”  If you are in a small single forest single Active Directory domain, the answer is easy.  If you have multiple forests or many domains, you may find yourself running to a spreadsheet to get the answer. My teammate Ryan suggested using NLTest: nltest /dsaddresstosite:192.168.1.10, which gives you…

Read more
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 42
  • Next

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy