有两个用户帐户,一个是管理员帐户;另一个是管理员帐户。另一个是普通用户。
(B)情况:我将PowerShell复制到Windows 10客户端并执行脚本,我得到了错误消息:
New-Item:访问注册表项 'HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ OneDrive'被拒绝。 在C:\ Users \ alanb \ Desktop \ Handling_OneDrive_REG.ps1:47 char:58
- ... HKLM:\ Software \ Policies \ Microsoft” |新项-名称“ OneDrive” -Force
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo:PermissionDenied:(HKEY_LOCAL_MACH ... rosoft \ OneDrive:S tring)[新项], UnauthorizedAccessException
- FullyQualifiedErrorId:System.UnauthorizedAccessException,Microsoft.PowerShel
l.Commands.NewItemCommand New-ItemProperty:找不到路径 'HKLM:\ Software \ Policies \ Microsoft \ OneDrive',因为它没有 存在。在C:\ Users \ alanb \ Desktop \ Handling_OneDrive_REG.ps1:50 char:5New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\OneDriv ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo:ObjectNotFound:(HKLM:\ Software ... rosoft \ OneDrive:Str)[New-ItemProperty], ItemNotFoundException
- FullyQualifiedErrorId:PathNotFound,Microsoft.PowerShell.Commands.NewItemProp ertyCommand New-ItemProperty:找不到路径 'HKLM:\ Software \ Policies \ Microsoft \ OneDrive',因为它没有 存在。在C:\ Users \ alanb \ Desktop \ Handling_OneDrive_REG.ps1:51 char:5
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\OneDriv ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo:ObjectNotFound:(HKLM:\ Software ... rosoft \ OneDrive:Str)[New-ItemProperty], ItemNotFoundException
- FullyQualifiedErrorId:PathNotFound,Microsoft.PowerShell.Commands.NewItemProp ertyCommand New-ItemProperty:找不到路径 'HKLM:\ Software \ Policies \ Microsoft \ OneDrive',因为它没有 存在。在C:\ Users \ alanb \ Desktop \ Handling_OneDrive_REG.ps1:52 char:5
New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\OneDriv ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo:ObjectNotFound:(HKLM:\ Software ... rosoft \ OneDrive:Str)[New-ItemProperty], ItemNotFoundException
- FullyQualifiedErrorId:PathNotFound,Microsoft.PowerShell.Commands.NewItemProp ertyCommand
我还设置了以下一些设置:
谢谢