Good morning Spiceworks…<\/p>\n
I have a power shell question for you.<\/p>\n
I am attempting to start looking at our systems to implement Bitlocker on some of my domain computers. I am attempting to determine what bios level they are at, and if the systems have TPM enabled, of if they have the TPM chip.<\/p>\n
I have made this script, and everything runs great untill it tries to read the line<\/p>\n
root\\CIMV2\\Security\\MicrosoftTpm<\/p>\n
I get “access denied” when i run it both as a domain admin, and a local admin, i have also \"run it as administrator<\/p>\n
all systems are windows 7.<\/p>\n
i can run the script on my local computer just fine, but trying to do remote computers is when i get “access denied”<\/p>\n
foreach ($computersystem in Get-Content c:\\powershell\\ggComputerList.csv)\n{\n$computerinfo = get-wmiobject -computername $computersystem Win32_ComputerSystem\n$computerBIOS = get-wmiobject -computername $computerSystem Win32_BIOS\n$computerOS = get-wmiobject -computername $computerSystem Win32_OperatingSystem\n$tpm = Get-WmiObject -class Win32_Tpm -namespace root\\CIMV2\\Security\\MicrosoftTpm -ComputerName $computerSystem\n\"System Information for: \" + $computerinfo.Name\n\"\"\n\"Manufacturer: \" + $computerinfo.Manufacturer\n\"Model: \" + $computerinfo.Model\n\"Serial Number: \" + $computerBIOS.SerialNumber\n\"Bios Version: \" + $computerBIOS.Version\n\"TPM: \" + $tpm\n\"Operating System: \" + $computerOS.caption + \", Service Pack: \" + $computerOS.ServicePackMajorVersion\n\"Total Memory in Gigabytes: \" + $computerinfo.TotalPhysicalMemory/1gb\n\"User logged In: \" + $computerinfo.UserName\n\"Last Reboot: \" + $computerinfo.ConvertToDateTime($computerOS.LastBootUpTime)\n\"\"\n\"\"\n}\n<\/code><\/pre>","upvoteCount":6,"answerCount":12,"datePublished":"2014-02-03T12:40:06.000Z","author":{"@type":"Person","name":"paulsterud8853","url":"https://community.spiceworks.com/u/paulsterud8853"},"acceptedAnswer":{"@type":"Answer","text":"$tpm = Get-WmiObject -class Win32_Tpm -namespace root\\CIMV2\\Security\\MicrosoftTpm -ComputerName $computerSystem -Authentication PacketPrivacy\n<\/code><\/pre>\nthis fixed it thanks for your help<\/p>","upvoteCount":1,"datePublished":"2014-02-03T13:24:14.000Z","url":"https://community.spiceworks.com/t/powershell-query-wmi-tpm-access-denied-remote-computers/273932/12","author":{"@type":"Person","name":"paulsterud8853","url":"https://community.spiceworks.com/u/paulsterud8853"}},"suggestedAnswer":[{"@type":"Answer","text":"
Good morning Spiceworks…<\/p>\n
I have a power shell question for you.<\/p>\n
I am attempting to start looking at our systems to implement Bitlocker on some of my domain computers. I am attempting to determine what bios level they are at, and if the systems have TPM enabled, of if they have the TPM chip.<\/p>\n
I have made this script, and everything runs great untill it tries to read the line<\/p>\n
root\\CIMV2\\Security\\MicrosoftTpm<\/p>\n
I get “access denied” when i run it both as a domain admin, and a local admin, i have also \"run it as administrator<\/p>\n
all systems are windows 7.<\/p>\n
i can run the script on my local computer just fine, but trying to do remote computers is when i get “access denied”<\/p>\n
foreach ($computersystem in Get-Content c:\\powershell\\ggComputerList.csv)\n{\n$computerinfo = get-wmiobject -computername $computersystem Win32_ComputerSystem\n$computerBIOS = get-wmiobject -computername $computerSystem Win32_BIOS\n$computerOS = get-wmiobject -computername $computerSystem Win32_OperatingSystem\n$tpm = Get-WmiObject -class Win32_Tpm -namespace root\\CIMV2\\Security\\MicrosoftTpm -ComputerName $computerSystem\n\"System Information for: \" + $computerinfo.Name\n\"\"\n\"Manufacturer: \" + $computerinfo.Manufacturer\n\"Model: \" + $computerinfo.Model\n\"Serial Number: \" + $computerBIOS.SerialNumber\n\"Bios Version: \" + $computerBIOS.Version\n\"TPM: \" + $tpm\n\"Operating System: \" + $computerOS.caption + \", Service Pack: \" + $computerOS.ServicePackMajorVersion\n\"Total Memory in Gigabytes: \" + $computerinfo.TotalPhysicalMemory/1gb\n\"User logged In: \" + $computerinfo.UserName\n\"Last Reboot: \" + $computerinfo.ConvertToDateTime($computerOS.LastBootUpTime)\n\"\"\n\"\"\n}\n<\/code><\/pre>","upvoteCount":6,"datePublished":"2014-02-03T12:40:06.000Z","url":"https://community.spiceworks.com/t/powershell-query-wmi-tpm-access-denied-remote-computers/273932/1","author":{"@type":"Person","name":"paulsterud8853","url":"https://community.spiceworks.com/u/paulsterud8853"}},{"@type":"Answer","text":"Has PowerShell Remoting been enabled?<\/p>\n