Alan's Blog

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

Menu
  • About My Blog
Menu

Tag: Powershell Scriptlets

Fix User’s Home Directory Permissions with Take Ownership

Posted on February 15, 2017February 25, 2024 by Alan

Fix-HomeDrivePerms.ps1 is a PowerShell script which attempts to reset folder security when the permissions are really hosed.  It uses a take ownership function, Set-Owner, by Boe Prox, instead of takeown.exe, but does shell out to iCacls.exe.  I wrote this to fix home directories where a user might be logged on with files open a the…

Read more

Consolidating Data For Report: Getting from Group-Object to CSV

Posted on February 4, 2017 by Alan

I am working on some scripts which show AD domain controllers by their site.  My goal was to have the data combined so that  each site has a single row, with the server name and IP address for each site being shown joined by semi-colons.           None of the examples for…

Read more

Function to Get Splat Parameters from a CSV File

Posted on October 1, 2016October 8, 2016 by Alan

Splatting is the use of a hash table to pass parameters to a PowerShell script.  As PowerShell scripts grow in complexity, you may want to pass a large number of parameters multiple times, for scripts which spin up a lab environment, or for Desired State Configuration.  It took me a while to figure out how…

Read more

Suggesting a default filename

Posted on January 3, 2014 by Alan

I like to leave log files where people can find them.  Typically this is on their desktop, or in the same folder where the script ran from.  I wrote the following bit of code which creates a date based report file and offers it as a default.  It is pretty straightforward, but I did not…

Read more
  • Previous
  • 1
  • 2

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