Invoke-Command Example

I use this CmdLet all the time. It is really the bees knees as far as remote management of devices go. Here is an example to use as reference. $ComputerName = "SERVER01" $RemoteSession = New-PSSession -ComputerName $ComputerName #return a scalar value $results = Invoke-Command -Session $remoteSession -ScriptBlock { param($variablePassedToRemoteSession) $output = get-process $variablePassedToRemoteSession Write-output $output } -ArgumentList $variablePassedIn $results | Get-Member #return a more complex object $results = Invoke-Command -Session $remoteSession -ScriptBlock { param($variablePassedToRemoteSession) $process = Get-Process $variablePassedToRemoteSession Write-Output "Handles", $process. Read more →

Creating classes in C# for PowerShell use

Sometimes it is just easier to write compiled code! This is a small example of how to create a custom object in C#and then use it. C# Code Sample using System.Text; public class Beer { public string Name; public string Type; public Beer(string NameIn, string TypeIn) { this.Name = NameIn; this.Type = TypeIn; } } Create a folder with the same name as the dll that gets compiled and place the newly created dll in this folder. Read more →

PowerShell v5 has class!

PowerShell version 5.0 added the ability to use the class designator in scripts. Don Jones has a good write up on it. This allows for live .NET framework class creation. This is a REALLY nice feature. There were a few ways to create custom objects in PowerShell before this, including specifying c# code directly in the script, using add-member and other ways. These all worked fine, but each has rather annoying limitations or overhead. Read more →

Remotely managing a WDS server with PowerShell or WDSUTIL

If you try to run any of the CmdLets in the WDS PowerShell cmdlets remotely via Invoke-Command, Enter-PSSession, CIMSession, or even PSEXEC it will fail with the error: _The operation being requested was not performed because the user has not been authenticated. If this is happening to you, you are screwed. Kind of. Remotely managing an AD Integrated WDS is simply impossible as far as I can tell. To fix this is you have to remove the WDS role and then add it again. Read more →

My Home Lab

A prerequisite read to this is here. Don Jones is a genius. Enough said. And a special shout out to @MeghNeupane for the initial hardware recommendation. Recently I transitioned professionally from internal IT to external customer facing IT. This is a much more fast paced and cutting edge field to be in and as such I determined it was time to take my home lab setup much more seriously. I simply needed a place to work on things on a whim that were not constrained in any such way. Read more →

ConfigMgr – Add OS Requirements to an application deployment type

This was updated again 6/1/2017. Changes were needed in order to avoid corruption. Mainly, a new GUID needed to be generated and used in order to ensure the changes were recognized. Hat tip to Jeff Scripter for figuring this out. Thank you. This was updated 6/21/2016. The script was over hauled to handle windows 10, multiple deployment types and more. The script and supported files can be found on github here. Read more →

Modifying App-V Pass through Filters (reg_sz mult)

In PowerShell v5.0 passthrough filters were implemented that prevent certain registry keys and values to be part of the virtual package. Good article here. One of these is the HKLM\Software\Policies key. This essentially prevents a virtual package from overriding GPO settings. That’s normally awesome, but what if I really wanted some policy settings in my package as opposed to on the workstation itself? This is possible. Below is an example of how to modify a multi value registry string. Read more →

Endpoint Protection Installation Failing during OSD after 2012 R2 CU4

After updating to ConfigMgr 2012 R2 CU4 I ran into some issues with task sequences that were deploying System Center Endpoint Protection (SCEP). The nis_full.exe (Network Inspection Service definition updates) were not installing and failing with a vague error in the event viewer. Microsoft Antimalware has encountered an error trying to update signatures. New Signature Version: Previous Signature Version: Update Source: User Update Stage: Install Read more →

Giving back to the community

I want to give a shout to all of those who have taken the time and energy to share content with the community. Be it a personal blog, forums contributions, or participation at a local user group. Without that powerful minority of people the technical (and most other professions) as a whole would be far less efficient. This is no small task as this profession is pretty demanding. It takes someone with serious commitment and passion to find the time outside of the normal hectic day to day to contribute to the community. Read more →