My Profile Photo

duffney.io


DevOps Engineer | Pluralsight Author | Speaker | Blogger | PowerShell Advocate


  1. Move all Members of an ActiveDirectory Group to being just Members with PowerShell

    Applies to: Windows PowerShell 3.0+ Recently my team and I discovered an Active Directory group that was causing token bloat within our environment. The reason was due to someone place 246 objects in the members of section of the AD group, when they should have been in the members section. Active Directory Administration tool makes removing them from the member of easy, but add them to the members section first not so easy. To solve...…


  2. Change System Center Configuration Manager Client Cache Size with PowerShell

    Applies to: Windows PowerShell 3.0+ The only way to set the Configuration Manager client cache size is by specifying it at installation. This was troublesome for me as I left it the default 5GB at install, but then was requested to deploy some AutoDesk packages that where of course over that 5GB limit. Knowing I could not rely on the end user to change their cache size, I knew I had to find a better...…


  3. Fix 0KB Driver Packages in System Cennter Configuration Manager 2012 with PowerShell

    Applies to: Windows PowerShell 3.0+, SCCM There is a known issue with System Center Configuration Manager 2012, where after importing or creating a driver package the size could be 0KB. The problem is, it causes a task sequence that is using the driver package to fail. Since the size is 0, it thinks that the driver package isn’t distributed to the distribution points. To resolve this you must perform the following actions in the console....…


  4. Run CMD Commands within a PowerShell Script

    Applies to: Windows PowerShell 2.0+ Sometimes when you enter commands into PowerShell they don’t execute the same way as they would in the command prompt. I ran into this issue with an uninstall string for a security software called Cylance Protect. The uninstall string looks like this: msiexec /Lvx* c:\Temp\MsiUnInstall.log /x {2E64FC5C-9286-4A31-916B-0D8AE4B22954} /qn When I executed it within the command prompt it ran as expected, however when executed in PowerShell it pulled up the msi...…


  5. Remove Blank Lines from Foreach Results

    Applies to: Windows PowerShell 3.0, Windows PowerShell 4.0, Windows PowerShell 5.0 While creating a script that gathers all the product codes of .MSI files in a directory, I discovered a problem. The variable that I had place them in was generating blank lines between my variables. Below is an example of the problem After not being able to Google the correct combination of works, I quickly posted this problem to the Spiceworks community to help,...…