- 1 year ago
Powershell Cmdlets to provide access to new user on shared path in windows 2003
Comment
1 / 1
In Windows Server 2003, you can use PowerShell cmdlets from the PowerShell Community Extensions (PSCX) module to provide access to a new user on a shared path. Here are the steps to achieve this:
Install PowerShell Community Extensions (PSCX):
- Download the PSCX module from the PowerShell Gallery: https://www.powershellgallery.com/packages/Pscx
- Extract the downloaded ZIP file and copy the PSCX folder to one of the module directories listed in the
$env:PSModulePath
environment variable.
Open PowerShell and import the PSCX module:
powershellImport-Module PSCX
Grant access to the shared path for the new user:
powershell# Replace 'C:\SharedFolder' with the actual path of your shared folder
$sharedFolderPath = 'C:\SharedFolder'
# Replace 'NewUserName' with the username of the new user
$newUserName = 'NewUserName'
# Grant Read and Write permissions to the shared folder for the new user
Grant-Permission -Path $sharedFolderPath -Account $newUserName -AccessType Allow -Permission Read,Write
This will provide the new user with Read and Write access to the shared folder. If you need to grant other permissions, you can modify the -Permission
parameter accordingly. Additionally, you can use other cmdlets from PSCX, such as Grant-Permission
and Revoke-Permission
, to manage access control to shared folders.