bibi92
asked on
call icacls on powershell script failed with user variables
Hello,
I try to execute this powershell script :
$Domain="test"
$User="dba"
$UD = $Domain +"\"+ $User
Invoke-Item "icacls.exe c:\test\ /T /C /grant '%UD:(OI)(CI)F'
This message is returned :
$U: No mapping between account names and security IDs was done.
How can I resolve this problem?
Thanks
bibi
I try to execute this powershell script :
$Domain="test"
$User="dba"
$UD = $Domain +"\"+ $User
Invoke-Item "icacls.exe c:\test\ /T /C /grant '%UD:(OI)(CI)F'
This message is returned :
$U: No mapping between account names and security IDs was done.
How can I resolve this problem?
Thanks
bibi
ASKER
I have try your command :
$UD: No mapping between account names and security IDs was done.
Successfully processed 0 files; Failed processing 1 files
Thanks
bibi
$UD: No mapping between account names and security IDs was done.
Successfully processed 0 files; Failed processing 1 files
Thanks
bibi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
bibi
bibi
$Domain="test"
$User="dba"
$UD = $Domain +"\"+ $User
icacls.exe c:\test\ /T /C /grant '$UD:(OI)(CI)F'
You used %UD this won't work :).