RSS

Tag Archives: Script

PowerShell – Advanced Function Template

I’m currently reading the great book ”Learn PowerShell In A Month Of Lunches“.As it turns out there is a lot I can still improve on (which I already knew ofcourse).

Part of the book covers properly creating an advanced function. I’ve taken these sample scripts and added additional comments so I can more easily use it for future functions. You can find it here.

 
Leave a comment

Posted by on March 4, 2013 in Uncategorized

 

Tags: , , , , , ,

PowerShell – Extract specific info from multiple source winaudit files

I run Winaudit on each server/system and save it to a central location named <computername>.csv                 This way I have access to a lot of information about each system. If you need a specific subset of information for each system however, you don’t want to have to open each file manually to get this information.

This script will parse each <computername>.csv to extract specifc information and save it to one new file containing this info for all parsed separate files.

 
Leave a comment

Posted by on February 25, 2013 in Automation, ICT, Microsoft, Powershell

 

Tags: , , , , , , , , , , ,

PowerShell – Get-GroupMemberships

This script determines the group membership of Active Directory users.

In this case, some users are member of multiple functional groups (groupname “*-core”), while the design assumes a user can only be a member a single functional group. This script helps determine the functional groups they are a member of.

Especially with a large number of users, scripting will save you a lot of time.

 

Tags: , , , , , , , , , , , , , ,

Powershell – Get WSUS clients Without Sync Or Report In X Days

One of the tasks of a WSUS administrator is to make sure that WSUS clients are up-to-date. This requires the WSUS clients to report to the WSUS server on a regular basis.

So if clients do not report to the WSUS server, you need to investigate and resolve the issue.

This script will show you which WSUS clients haven’t reported in X days:
http://bjornhouben-web.sharepoint.com/Lists/Scripts/DispForm.aspx?ID=21

Another use case would be if you manage a WSUS infrastructure with an upstream server and multiple downstream servers for each customer. If one or more 3rd parties are responsible for managing the WSUS clients, you could use this script to automatically mail them the clients they’re responsible for that haven’t reported for X days.

 
Leave a comment

Posted by on February 17, 2013 in Automation, ICT, Microsoft, Powershell, Windows, WSUS

 

Tags: , , , , , , , ,

Powershell – Get Percentage of Pysical and Virtual Servers from your VMware and Cisco UCS combined for each location

In a previous blog post I’ve already shown this script that use PowerCLI to get the percentage of physical and virtual servers from your VMware environment for each Virtual Center server. This script however only took into account ESX hosts and VM’s in each Virtual Center server separately.

This means that:

  • The UCS blades weren’t taken into account as physical servers.
  • No percentage was being calculated for each physical location.

This new script automates determining for each location the number of physical and virtual servers in VMware vSphere and Cisco UCS.

PS: You can get more detailed information from the script, but it has been disabled using comments by default.

 

Tags: , , , , , , , , , , , , , , , , , , , , ,

PowerShell – Get UCS Blade Count

PowerShell has been adopted by many companies already including VMware and Cisco with its Unified Computing System (UCS).

This simple script will use the Cisco UCS PowerTool to connect to UCS and determine the blade count for each UCS server you’ve defined.

 

Tags: , , , , , , , ,

PowerShell – Get the percentage of physical and virtual servers from your VMware environment

With the current focus on Corporate Social Responsibility (CSR) including Green IT, it might be important to know what percentage of servers has been virtualized.

This script I made will use PowerCLI to get the percentage of physical and virtual servers from your VMware environment for each Virtual Center server. You can specify multiple Virtual Center servers if desired.

 

Tags: , , , , , , , , , , , , , , , , ,

PowerShell – Slipstream Office 2003 Updates

In yesterday’s post I described how you could extract Office 2003 updates. When they are extracted however, they still need to be slipstreamed into the package. I also created this script to automate the slipstreaming.

Basically for each extracted patch (.msp) file, it runs msiexec with the correct parameters. So if you have other msi packages that need multiple patch (.msp) files applied to it, you could use this script as a foundation as well.

 

Tags: , , , , , , , , , , ,

PowerShell – Extract Office 2003 Updates

Not so long ago I had to create a new Office 2003 Administrative Installation Point.

There were 2 choices:

  1. Use the default ISO and have WSUS handle patching after each install.
  2. Slipstream all available patches in the Office 2003 Administrative Installation Point.

Ofcourse option 2 is the best choice, because then the package will be the most secure from the moment the software is deployed. Also it saves bandwidth and time.

To slipstream updates into Office 2003, there are basically 4 steps:

  1. Extract the original Office 2003 files.
  2. Download the updates you want to slipstream.
  3. Extract the updates you want to slipstream.
  4. Slipstream the updates into the extracted Office 2003 files.

You can imagine that the older the source files are, the more updates there are to be slipstreamed. So it is best to use an ISO/CD of Office 2003 with the latest Service Pack.

Still if you have the latest Service Pack, you need to slipstream more than 20 updates. I personally don’t like these kind of manual tasks, so I created this script to do the extraction of the updates for me.

Ofcourse this script can be used to extract other kinds of updates as well..

 

Tags: , , , , , ,

PowerShell – Determine which Active Directory objects are protected from accidental deletion

In yesterday’s post I showed some commands to protect all or specific Active Directory objects from accidental deletion.

In some situations (by example preparing for a change) you might want to know which objects are protected from accidental deletion and which are not. Also when multiple people make changes in an Active Directory it might prove difficult to keep track of the changes.

To determine the protection status of AD objects, I use a script that checks the ACL of the AD Object. When Everyone is explicitly Denied access, it is protected from accidental deletion.

 

Tags: , , , , , , , , , , , ,

 
Follow

Get every new post delivered to your Inbox.

Join 492 other followers

%d bloggers like this: