Workstations by OSD Method - Useful for reporting non-standard deployments.
Use RegKey2MOF to add a MOF for HKLM\Software\Microsoft\Deployment 4
SELECT b.Name0
,c.UniqueUserName
,b.Domain0
,d.Version0
,d.Caption0
,a.[TimeStamp]
,a.[DeploymentMethod0]
,a.[DeploymentSource0]
,a.[DeploymentTimestamp0]
,a.[DeploymentToolkitVersion0]
,a.[DeploymentType0]
,a.[OSDAdvertisementID0]
,a.[OSDPackageID0]
,a.[OSDProgramName0]
,a.[TaskSequenceID0]
,a.[TaskSequenceName0]
,a.[TaskSequenceVersion0]
FROM [CM_I01].[dbo].[v_GS_OSDInformation_OSDInfo_2_00] a
join v_GS_SYSTEM b on a.ResourceID=b.ResourceID
join v_UserMachineRelation c on a.ResourceID=c.MachineResourceID
join v_GS_OPERATING_SYSTEM d on a.ResourceID=d.ResourceID
where SystemRole0 = 'Workstation'
Friday, July 29, 2016
Monday, July 18, 2016
Powershell: List AD Group Members in Table and Export to CSV
Import-Module ActiveDirectory
$Groups = (Get-AdGroup -filter * | Where {$_.name -like "NAME*"})
$Table = @()
$Record = [ordered]@{
"Group Name" = ""
"Name" = ""
}
Foreach ($Group in $Groups)
{
$Arrayofmembers = Get-ADGroupMember -identity $Group | select name
foreach ($Member in $Arrayofmembers)
{
$Record."Group Name" = $Group
$Record."Name" = $Member.name
$objRecord = New-Object PSObject -property $Record
$Table += $objrecord
}
}
$Table | export-csv "C:\temp\SecurityGroups.csv" -NoTypeInformation
$Groups = (Get-AdGroup -filter * | Where {$_.name -like "NAME*"})
$Table = @()
$Record = [ordered]@{
"Group Name" = ""
"Name" = ""
}
Foreach ($Group in $Groups)
{
$Arrayofmembers = Get-ADGroupMember -identity $Group | select name
foreach ($Member in $Arrayofmembers)
{
$Record."Group Name" = $Group
$Record."Name" = $Member.name
$objRecord = New-Object PSObject -property $Record
$Table += $objrecord
}
}
$Table | export-csv "C:\temp\SecurityGroups.csv" -NoTypeInformation
Subscribe to:
Posts (Atom)