Alan's Blog

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

Menu
  • About My Blog
Menu

Tag: Scripting

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

Getting GPO GUID, Name from Active Directory

Posted on October 20, 2017 by Alan

You don’t have to rely on the Group Policy Module to resolve the display name of a GPO from the GUID, or the GUID from the display name.  Here are two short functions that will get that information from Active Directory. The first will return the GPO displayname attribute from a GUID. The GUID (sometimes…

Read more

Add-WindowsFeature Alternative for Client OS

Posted on September 2, 2017September 23, 2017 by Alan

Waiting for the add remove features dialog populate on my client OS computer is slow.  Since I started using Add-WindowsFeature wither Server 2008, and Install-WindowsFeature beginning with Server 2012, I was disappointed by the lack of a similar cmdlet for Windows 10.  Unfortunately, Add/Install-WindowsFeature relies on ServerManager — which doesn’t exist on a workstation.  The…

Read more

Fix Creation Date Later than Date Modified with PowerShell

Posted on August 13, 2017 by Alan

A weird and annoying thing happened to my home directory at work when it was moved from Windows to a storage appliance. The file CreationTime was lost on all the files and was set to the date of the data move. Particularly annoying was seeing the CreationTime being more recent than the LastWriteTime attribute. At…

Read more

Adding Terminal Services Information to User Reports

Posted on February 4, 2017October 14, 2017 by Alan

Add-ADTSInfo.ps1 adds TerminalServicesHomeDrive, TerminalServicesHomeDirectory, TerminalServicesProfilePath and AllowLogon as additional members returned by a query of Active Directory user objects.  As you may know, when looking at a user’s properties in the Active Directory Users and Computers MMC there is a tab for these fields.  However, if you look at the properties of a user object, these…

Read more

Get Oldest Windows Event

Posted on February 13, 2016 by Alan

Get-OldestEvent.ps1 is a PowerShell advanced function which returns the oldest event from a Windows computer event log, and will help you determine the rollover time for an event log by also returning the age of the record as a time span with the time created. Optionally you can return the entire oldest record with the…

Read more

Passwords for Password Resets

Posted on September 7, 2015September 7, 2015 by Alan

I discovered that my script to generate passwords, RandomPW.vbs, isn’t popular with users because the passwords are random.  I have an even more complicated but unposted PowerShell version with the same issue. I wanted to create something that was easier for the help desk and users.  Get-TempPW.ps1 is my answer to those objections.  This script…

Read more

Test Whether Organizational Unit or Account Exists

Posted on September 7, 2015 by Alan

Here are two quick functions which I have recently found useful. The first tests whether a user account exists. It takes the Domain and Identity as arguments. Using the “Stop” error action with Try/Catch keeps it from showing any errors. You can do this with any of the AD cmdlets, such as Get-ADOrganizationalUnit, Get-ADComputer and…

Read more

That VbScript worked in XP, Why Not Now?

Posted on January 30, 2014 by Alan

Do you have a script that worked with your x32 XP computer, but no longer works in Windows 7 or 8 x64?  I am finding that some of the scripts I wrote have this problem.  Somethings may rely on an ActiveX control that was native to XP but not a later version.  What I am…

Read more

Laptop Return Reminder

Posted on February 3, 2013 by Alan

We love our users, yes we do!  Especially the ones who walk out the door with a laptop that they refuse to return.  Having a computer off the corporate network for an extended period of time can create problems with Active Directory,  some management software and some encryption software.  MakeLaptopWarning.vbs is a script which the…

Read more
  • 1
  • 2
  • 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