Issues with Mount-DiskImage in PSRemoting

I’m currently trying to batch update a bunch of our old servers using WSUS Offline Updater, and I’m running into an issue with the script to run on remote servers. Each time I run it, I get “Access-Denied” when attempting to run it, I’ve opened up the Powershell Session as Administrator as well as with Domain Admin Credentials, as well as trying to add in the Credentials, but nothing seems to work. Can someone help me troubleshoot what the issue is?

I’ve also attempted this with just the data in the Foreach Loop, and still it errors out when trying to Mount the ISO.

Enter-PSsession $Server $scriptlocation = '\fileserverwsusoffline-w100-x64.iso' Mount-DiskImage -ImagePath $scriptlocation -Verbose $Volume = Get-Volume | where FileSystemLabel -eq 'WOU_w1009-x64' $drive = $Volume.DriveLetter $drive += ':' set-location '$Drive' Invoke-Expression .cmdDoUpdate.cmd Dismount-DiskImage -ImagePath $scriptlocation -Verbose Restart-Computer 

submitted by /u/scotchlover
[link] [comments]

Leave a Reply