Specification-
1.1 Prerequisites
PowerShell Version 2.0 or later is installed
The device is managed by Managed Workplace MW2013R1FP3
1.2 Supported Operating Systems and/or Product
Windows XP, Windows Vista, Windows 7, Windows 8, Small Business Server 2003, Windows Server 2003, Small Business Server 2008, Windows Server 2008, Windows Server 2008 R2, Small Business Server 2011, Windows Server 2012, Windows Server 2012 R2
1.3 Scripting Language
Powershell Version 2.0
2.1 Functionality
1. Determine the Operating Systems architecture
a. Determine if the install version of Windows is 32-bit or 64-bit by querying WMI using the Win32_Processor class and fetching the value of "AddressWidth"
2. Determine the devices identity
a. Parse the Windows Uninstall folder in registry to determine if the device is an Onsite Manager, Device Manager or a Managed Device
i. Onsite Managers
::32 Bit Value::
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F6C58411-6F72-4B96-84FF-9950C812A359}
::64 Bit Value::
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F6C58411-6F72-4B96-84FF-9950C812A359}
ii. Device Managers
::32 Bit Value::
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{07E29EC9-5BB8-45FB-A8B8-D3D4A1BAEEFD}
::64 Bit Value::
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{07E29EC9-5BB8-45FB-A8B8-D3D4A1BAEEFD}
iii. Managed Device
The Onsite Manager nor the Device Manager will not be installed on the Target Device
3. Determine if the device is patch managed or not patched managed.
a. Onsite Managers
i. Determine if the following 2 registry keys are present or not. If present then the device is patched managed
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUServer
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUStatusServer
b. Device Managers
Determine if the following 2 registry keys are present or not. If both are the only keys present then the device is patched managed.
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUShutdownOption
c. Managed Device
Determine if the following registry key is present. If it is not present then it is not patch management by Managed workplace.
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
2.2 Script Parameters
Reboot Server
Optional = unchecked
Key = server
Label = Reboot Server
Type = Integer
Minimum = 0
Maximum = 1
Default Value = 0
Reboot Workstation
Optional = unchecked
Key = workstation
Label = Reboot Workstation
Type = Integer
Minimum = 0
Maximum = 1
Default Value = 1
Patch Non-Patch Managed Devices
Optional = unchecked
Key = NonPatched
Label = Patch Non-Patch Man Devices
Type = Integer
Minimum = 0
Maximum = 1
Default Value = 0