0

I'm currently trying to pull msinfo data from a remote server and then save that output onto a share located on another server. When I run the command, a progress bar appears and then completes without apparent issue, but the file isn't saved to the UNC path. I've verified that I have permissions on the share and that the nfo generation itself works. Any ideas?

C:\Windows\system32>msinfo32 /computer servername /nfo \\sharename\filename.nfo
Mike Shepard
  • 17,466
  • 6
  • 51
  • 69
mosaic3
  • 1
  • 1

2 Answers2

0

Very Strange, It works on CMD but not with Powershell, Not had the time to explore it, However If you need to run it in powershell you can take this workaround:

$TempFile = [System.IO.Path]::GetTempFileName()
C:\Windows\system32\msinfo32 /computer Computer /nfo $TempFile
Do
{
Sleep 5
}
Until (!(Get-Process msinfo32 -ErrorAction SilentlyContinue))
Copy-Item $TempFile \\Computer\Share\output.nfo
$TempFile | Remove-Item -Force
Avshalom
  • 8,657
  • 1
  • 25
  • 43
  • Well, I think I found the issue - the admin account that I'm launching PS with has access to the server I'm pulling the nfo data from, but it does not have write access to the share. So I guess the question is, can I launch PS as an admin, pull the nfo and then switch to the other user account to copy the info? – mosaic3 Jul 07 '15 at 13:11
0

Got it figured out - I was able to use the switch user param to save the file after pulling it from the server.

Thanks!

mosaic3
  • 1
  • 1