Remote PowerShell Commands With WinRM Disabled And Windows PowerShell

WinRM is extremely useful when using Windows Powershell - but what do you do when it is disabled? How do you work with PowerShell on remote machines without breaking security policy? I explore a method to be able to do this using existing remote technologies which will not make security upset at you.

Read More

Get-ADUser times out after 2 minutes

This past week I was approached by a coworker that had a script which was timing out in less than 30 minutes - the default ADWS timeout. They were using get-aduser with a few conditions in the filter parameter, resulting in only about 30 user accounts being returned. The query was randomly timing out and there was no immediate clue as to why in the error message. This is being run against a complex ad environment with 80k+ users in the environment. After doing some searching around the error results from the timeout between paginated results. After finding this page the answer became obvious.

Because there are so few results being returned due to the filter in such a large environment - and the default pagination size is 256 results the timeout of two minutes is being hit. In this case - since there were only 30 or less results the pagination limit of 256 was never hit and therefore if the query took more than two minutes an error was returned. The simple solution is to reduce the number of results returned on each “page” of results by setting the parameter ResultPageSize to a lower number. In this case, because they were only expecting 30 / 80k+ users to be returned we set the ResultPageSize parameter to 1. This means that for each result returned, the two minute time limit is once again refreshed preventing the query from timing out.

HPE Synergy Automation - Mounting Virtual Media and Override Boot Order

HPE Synergy and OneView not only allows you to create server profiles automatically but also set a one time boot options even on UEFI servers and boot to ISOs which are stored on a web server to install the operating system on multiple servers simultaneously.

Read More

Validating CSV Headers In Your Scripts

Validating csv files tends to be one of those things that has to be customized for each script. I was tired of this, and wanted to make a way to be able to validate csv files before any of the script was run to prevent issues - so I created a new project to be able to validate CSV files and return WHAT of the csv file is invalid.

This is only the first start of the project with more to come eventually to allow the cmd to be a little more flexible in HOW it determines if a CSV is valid or not.

Read More

HPE Synergy Automation - Creating Server Profiles

HPE OneView offers multiple ways to automate the infrastructure in the datacenter. The basis for automating the hardware are server profiles and server templates. Deploying templates can be simplistic but with a little additional code, this simple concept can be expanded to automatically deploy templates to profiles and wait for the creation of the profiles to complete.

Read More