Pull registry info from multiple domain computers

This topic contains 2 replies, has 2 voices, and was last updated by  Andrew 3 months, 1 week ago.

  • Author
    Posts
  • #94090

    Andrew
    Participant

    I am trying to get a powershell script to reach out to a batch of domain computers and pull the specific information from them and put the information back into a .csv file. The challenge is that I think I need 'permissions' to log into each computer to get that information but I am not sure how that would work with the system names sitting in a txt file. Any suggestions would be appreciated.

    $C = Get-Credential
    -credential $C
    $computernames = Get-Content -Path "c:\scripts\test.txt"
    Get-EventLog -ComputerName $computernames -LogName System | Where-Object {$_.EventID -eq "1074" -or $_.EventID -eq "6008" -or $_.EventID -eq "1076"} | sort TimeWritten | ft Machinename, TimeWritten, UserName, EventID, Message | Export-Csv -Path "c:\scripts\appevents.csv"

    Andrew

  • #94093

    Don Jones
    Keymaster

    The challenge is that I think I need 'permissions' to log into each computer to get that information but I am not sure how that would work with the system names sitting in a txt file. Any suggestions would be appreciated.

    Indeed you do. Whatever account you run PowerShell with must have those permissions. Unless PowerShell Remoting is enabled on those computers, there's no universal way to specify credentials to a remote machine. Get-EventLog doesn't support doing so, for example. Typically, you need to run the script as an account which is recognized as an Administrator on the remote machine.

  • #94102

    Andrew
    Participant

    I doubt Powershell remoting is installed on any of the systems. If I remove the credentials and log in and run with an admin account on my PC, things should work then? Everything else look good?

You must be logged in to reply to this topic.