Category: PowerShell
-
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:
-
PowerShell wrapper function to display a dialog box
I wanted a function that I could pass some text, and it would put that text in a dialog box for the user to click okay. Simple, but I will reuse it I am sure.
-
PowerShell script to change default prf imported when Outlook starts up for the first time
In this previous post, I talk about how we use Office Customization Tool (OCT) and “.prf” files to deploy Office 2010. Continuing with the idea that I want to know if a person is visiting from another office, I want to be able to switch from our default of “cached mode” to “online mode” for…
-
PowerShell: Two functions to determine if a user is visiting the office
If you have users in distribution groups associated with each site in your organization, it should be easy to tell if a user is visiting from another office (more on why I want to do this later). First function returns the current site that the user is logging into: The second function loops through all…
-
PowerShell to verify ACLs (permissions) on a folder
In my previous post, I showed how to create a new ACL and apply it to a folder. Why apply it to the folder if the folder is already set correctly? I wrote the following function to compare the ACLs of a folder to a desired set of ACLs (either created by hand (lines 3-12) or…
-
PowerShell to assign permission to a folder (not copy inherited permissions)
In my previous post, I used PowerShell to change the permissions of a top level folder. In that script, I took the folder in question and copied the inherited permissions to it, and then I tinkered it to be what I wanted. I wanted to do something similar, but I wanted a set of permission…
-
PowerShell: Return, ForEach,ForEach-Object and a pipe
I just figured this out late last night. I was pulling my hair out. If you look at the following PowerShell code You get a result of: 1 2 3 4 5 Next, if you look at this code (the only real difference being the lack of a pipe.) You get: 1 2 3 That…
