Tag: PowerShell
-
PowerShell script to force download and install WindowsUpdates
I have been using the UpdateHF.vbs vbscript for years to patch all my servers. I wrote a simple HTA to wrap it, and it gets executed by psexec. I wanted to take that script, strip it down, and convert it to PowerShell. My intension was to run it through a PSSession but I get access…
-
PowerShell script to “process” scripts/functions
I was not happy with the code I wrote in this post. The goal was to write my functions with a “generic” naming convention, and then “process them” – change the naming convention to match my employer’s company name. For example JBMURPHY-AD-GetCurrentSite would be “processed” to Company-AD-GetCurrentSite. In the previous post, I just looped thought…
-
PowerShell to create Aliases for all your functions
I have a naming convention for all the function that I write, for example: JBMURPHY-AD-GetGroup. I wanted to create aliases for all my functions with my employers’s name, for example CompanyName-AD-GetGroup. I created the following function to “grep” all the function names and create an “Alias” file. This file would have all the set-alias commands that…
-
PowerShell, Active Setup and running a SCCM package “before log on”
I have been struggling with the following idea for a while: How to run a package before before a person logs on using SCCM. There is a setting in SCCM that runs when no one is logged on, but if a person reboots and logs on before SCCM fires, the package will never run. Basically…
-
PowerShell Query to find a users computer name in SCCM
We rely on Remote Assistance. Usually, I just type “msra /offerra” in to my PowerShell session and lookup a the user’s computer name in the SCCM report named “Computers for a specific user name”. I wanted to make that process quicker. I wrote the following script to query SCCM for the “list of computer’s who’s…
-
PowerShell scripts to create a WinPE 4.0 wim/ISO
I have been a WinPE hacker since it was only available to SA subscribers. With Vista it was free to the world, and I started moving all my setup processes to it. I have always used the dos batch scripts found in this forum to create a new WinPE ISO. Since WinPE 4.0 is coming out…
-
Quick PowerShell script to run a command on every machine in an OU
I wanted to run a command on all machines in an OU. I know this documented all over the place, but this is the syntax I like:
-
Install OpenManage Server Administrator on ESXi5 via PowerCLI
Dell has changed how you install OpenManage Server Administrator on ESXi5. To do this via PowerCLI, use the following steps. Download the new vib file: OM-SrvAdmin-Dell-Web-6.5.0-542907.VIB-ESX50i_A02.zip (most recent can be found here) Extract it and upload the folder via the vSphere client (browse datastore and upload the extracted folder) Put the ESXi5 box into maintenance mode.…
-
PowerShell script to add Active Setup registry entries
I am interested in using Active Setup more throughout our environment. The thing I like about Active Setup is that if I screw up, it will only run once and not over and over! Kidding, but the “run one” nature of Active Setup is nice. I wanted a PowerShell function to create Active Setup registry…
-
Updated PowerShell to determine if a user is visiting the office
I made an error. More like an incorrect assumption in this post, specifically this code.: My incorrect assumption was that the AD PowerShell components were installed on every machine (they are only my machine). I needed to rewire this code above to use ADSI, since Get-ADGroupMember is not on everyone’s machine. Below is that code:
