Monday, December 18, 2017

SCCM: Query collection membership for specific system

Beneath you find a WQL query for listing all collection memberships for a specific system in SCCM I got some examples of the internet which didn't work for me. This query does and uses a prompt asking for a system resource name.
select COL.Name from SMS_Collection as COL
JOIN SMS_FullCollectionMembership as COLMEM on COL.CollectionID = COLMEM.CollectionID where COLMEM.Name = ##PRM:SMS_FullCollectionMembership.Name##
order by COL.Name
You can use this query within SCCM solely as a Query or as a collection membership query. For SQL queries and reports take a look here

Thursday, December 14, 2017

PowerShell: Encapsulate 64 bit cmdlet in a 32 bit context

Found a rather old but nice tip from Neil Peterson to tackle a challenge executing Powershell 64 bit cmdlets from a 32 bit execution context (Orchestrator in his example). Just wanted to share this and add it to my own blog for enhancing my toolbox.
#living in a 32 bit universe

#starting PowerShell 'sysnative' version and thus 64 bit
#more info: https://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx

$ClusterNodes = .$env:windir\sysnative\WindowsPowerShell\v1.0\powershell.exe {

 #living in a 64 bit universe
 Get-ClusterNode -Cluster clustername

}