Alan's Blog

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

Menu
  • About My Blog
Menu

Combine CSV Files to XLSX File with Worksheets

Posted on February 4, 2017 by Alan

Three years ago, I posted CombineXLSheets.vbs, a vbScript which allows you to drop and drag Excel spreadsheets onto it and have them combined into a single workbook file with multiple worksheets.  Now that I am working in PowerShell, I have found the need to consolidate CSV files.  Parts of  Combine-CSVFilesToWorksheets.ps1 come from code ported from…

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

Export to XLSX without Excel: Export-XLSX.ps1 Revisited and Tweaked

Posted on January 30, 2017February 5, 2017 by Alan

I often look at the code of others with respect and admiration. Peter Kriegel (Germany) wrote Export-XLSX.ps1, an amazing script which lets you export data into a real XLSX file without Excel being installed. The script also enables you to directly append worksheets to XLXS files. His website, http://www.admin-source.de, hasn’t been updated in a while,…

Read more

Get the NetBIOS AD Domain Name from the FQDN

Posted on January 30, 2017January 30, 2017 by Alan

I hate using NameTranslate, because it is a COM object, and because the output is often really hard to get into a clean, trimmed string.  The netBIOS name isn’t a part of the AD domain object, but I suspected that the information could be gotten using a LDAP query.  My searching lead me to a post…

Read more

Convert System.DirectoryServices.SearchResult to a PSObject

Posted on December 25, 2016December 25, 2021 by Alan

The ADSI accelerator is fast, and built into PowerShell, unlike the Active Directory Module.  When use it, or the ADSISearcher, you have results which look like this [Image from previous Microsoft URL]: Getting the properties out to a file can be tricky.  I wrote two little functions to make this easier: Function ConvertTo-PSObjectFromDirectorySearchResult($oDS){ $outval =…

Read more

Get COM Object Constants with PowerShell

Posted on December 25, 2016December 29, 2016 by Alan

I avoid using COM objects whenever I can. One of the annoyances is that you need to look up the value of constants. Shay Levy, in http://www.powershellmagazine.com/2013/03/20/pstip-working-with-excel-constants/ has a script which demonstrates how to enumerate the constants for the Excel COM object.  Get-COMConstants.ps1, is an advanced function generalization, which can be used for any COM…

Read more

Test Replication – A PowerShell Wrapper for RepAdmin

Posted on December 10, 2016January 18, 2017 by Alan

Repadmin is a standard tool in an AD admin’s toolbox, and “showrepl” displays the status of replication in your domain. The results of this command are quite verbose, and can make your eyes glaze over in late night troubleshooting.  A number of people have noticed that you can pipe RepAdmin CSV output to the ConvertFrom-CSV…

Read more

Remove DNS Host Record and PTR with PowerShell

Posted on December 10, 2016January 18, 2017 by Alan

You have been asked, “Please remove the host record for these 15 computers, plus their associated PTR records”.  It isn’t a difficult task, but it can be time consuming, especially if you have a large DNS database.  The in-addr.arpa bit can be annoying to do over and over again.  When I first decided to automate…

Read more

Who Added this User to the Domain?

Posted on December 10, 2016 by Alan

On of the questions that I am frequently asked is “who created that user”.  In a small shop, the answer should be “me”.  But in a really large environment the answer may not be quite so clear. When an object is created in Active Directory, the owner of the object is the creator of the…

Read more

My Windows 10 Fix

Posted on December 10, 2016December 10, 2016 by Alan

I had some issues with my Windows 10 computer at home.  I did some research, and came up with this batch file to freshen and check all of the operating system files.    Save this as Fix10.cmd (or Fix10.bat) and run it with admin rights. @echo off REM Fix10.cmd REM Alan Kaplan www.akaplan.com/blog REM This batch…

Read more
  • Previous
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • …
  • 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