Alan's Blog

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

Menu
  • About My Blog
Menu

Yes, Still Here

Posted on February 2, 2024 by Alan

I am still here, and still coding in PowerShell. I am very aggressive about new user approvals. If you have been accidentally deleted, please send me an email. The address should be pretty obvious.

Read more

Get IP Information from a Remote Computer

Posted on December 26, 2021February 25, 2024 by Alan

Get-IPInfo.ps1 is a script which uses invoke-command to run Get-NetIPConfiguration from a remote computer. The result is a quick way to get the IP configuration from a remote computer, and have it display in a textbox.

Read more

Get DNS Name from IP Address

Posted on December 26, 2021May 15, 2022 by Alan

Get-NameFromIP.ps1 demonstrates two functions which I use frequently: Function Test-IsIP ($strTest) { [Net.IPAddress]::TryParse($strTest, [ref]$null) } and Function Get-HostName($IP) { Try { ([System.Net.DNS]::GetHostByAddress($IP)).hostName } Catch { Write-Warning “Not resolved” } } Together these provide you with a good way of testing IP input from user and natively resolving IP addresses to DNS hostnames.

Read more

Export AD Users

Posted on December 26, 2021 by Alan

Export-ADUsers.ps1 is a GUI script which exports users with the attributes you select from any OU selected from a domain navigation menu. The list of available attributes are read from the Schema. There is special handling of some attributes and so it can return the domain, Enabled, userAccountControl and published certificates. Not required: admin rights…

Read more

Export Domain Group Members

Posted on December 26, 2021 by Alan

Export-DomainGroupMembers.ps1 is a GUI script which exports group membership with the attributes you select. It takes the group’s distinguishedname as a parameter, and supports very large groups. How large? I have enumerated groups with over 350,000 members in a multidomain forest. You can get nested group membership, even if there are recursion loops. The list…

Read more

Get the most recent computer and user GPO Events from local or remote computer

Posted on December 26, 2021 by Alan

Getting Windows Events can be painfully slow, but Get-WinEvent and a good filter can really speed things up. Get-GPOEvents.ps1, below, looks for the most recent cycle of user an computer GPO events found in in the Microsoft\Windows\GroupPolicy log. This data can be quite valuable in troubleshooting GPO issues.  It works by looking for the user…

Read more

Get User Lockout Information

Posted on December 26, 2021 by Alan

This script lets you see lockout events for a user from the domain controller on which the event(s) occurred. It accepts the user’s distinguished name as input,  enumerates the list of domain controllers, then finds the LockoutTime on each domain controller. It then calculates the time +/- 2 seconds, and queries the DC event log…

Read more

Manage Device on Remote Computer / List Connected USB Devices

Posted on December 26, 2021 by Alan

Remote access to the Plug and Play (PNP) RPC interface was removed in Windows 8, and since that time administrators have been unable to remotely manage Windows devices without RDP or a third party utility.  I haven’t been a desktop support person in years, and only recently learned about this, when troubleshooting a workstation with…

Read more

Get Logon and Unlock Events from Windows Computer

Posted on December 25, 2021 by Alan

It is faster to get events from the Security log locally then it is remotely. Get-LogonEvents.ps1 gets event 4624 using an XPath syntax query remotely executed with Invoke-Command: <# This is used to get interactive logon and unlock events from a remote PC Alan Kaplan, www.akaplan.com 4/14/2020 Public version 12/24/21 #> Param ( [Parameter(Mandatory =…

Read more

Get AD Replication Metadata

Posted on December 25, 2021 by Alan

Some Active Directory attributes are local to the domain controller where the event occurred, such as lastlogon, but most others are replicated to all domain controllers within that domain. This should be distinguished from the attributes which are part of the Global Catalog – those attributes are a subset of domain attributes which exist and…

Read more
  • 1
  • 2
  • 3
  • 4
  • …
  • 43
  • 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