Accessing a share - I've gotten myself confused, can someone please unconfuse me?
Ok so as usual you discover something new and think "Oh it'd be cool to do x with that".
I discovered the Export-WindowsDriver cmdlet in powershell and thought it would be cool to write a small script that I can PDQ out that will go and fetch the drivers and place them (in an organized manner) back on my laptop in a share I have setup.
here's the script
$WMI_OS = gwmi win32_operatingsystem
$WMI_CS = gwmi win32_computersystem
$OS = $WMI_OS.caption
$OSArchitecture = $WMI_OS.OSArchitecture
$Manufacturer = $WMI_CS.manufacturer
$Model = $WMI_CS.systemfamily
$DriverPath = \\MY_LAPTOP\Drivers$\$OS\$OSArchitecture\$Manufacturer\$Model
new-item -Path $DriverPath -ItemType Directory
Export-WindowsDriver -Destination $DriverPath -Online
The issue I am having is that my target computer doesnt have perms to write back to Drivers$ (powerhsell error the username/password is incorrect)
Now I am testing this out at home right now (my target PC is my main tower PC), so no domain or domain admin etc (which may be the issue)
but my laptop isnt on a domain (at all) even when I am at work, I give it the creds to access the remote PCs and everything just works, why is it that I give it the creds to access my remote PC in this situation and it fails?
In the end I got it working by activating the local admin account and setting the password to the same value...but I dont really understand why I have had to do this this time? much confusion
Comments
Your Deploy User needs permission to access the share. In a Workgroup environment that means the username and password must be identical.
That is a neat script. Thank you for sharing :)