I have the following PowerShell code:
$Domain = "VM-PRO"
[string] $SystemDrive = Get-CimInstance -Class Win32_OperatingSystem -CimSession $CimServer |
Select-Object -ExpandProperty SystemDrive
$SystemDrive = $SystemDrive.TrimEnd(":")
$AppPath = "\\$Domain\$SystemDrive`$\Users\$User\AppData"
Test-Path $AppPathWhich works just fine, System drive on remote server is C:\ and AppPath expands to:
\\VM-PRO\C$\Users\User\AppDataMy question is, what if system drive on remote computer is X:\ or something else?
Wouldn't that result is non existent share? ex:
\\VM-PRO\X$\Users\User\AppDataWhat I'm asking, is default share C$ always C$ or does it depend on actual system drive letter?
1 Answer
It does depend on the actual drive letter.
By default, Windows creates the following admin shares:
- Admin$ — Remote admin (this is the %SystemRoot% directory)
- IPC$ — Remote IPC (used in named pipes)
- C$ — Default Drive Share
If there are other partitions on the computer that are assigned a drive letter, they are also automatically published as admin shares (D$, E$, etc.).
If you are using a shared printer, there should be Print$; and FAX$ for a fax server.
1