Skip to content

Commit 1f7473c

Browse files
bobbytreedsdwheeler
authored andcommitted
Fixes #4306 - Update runasuser with SeInteractiveLogonRight qualifier (#4320)
1 parent 9adc59a commit 1f7473c

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

dsc/configurations/runAsUser.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,28 @@ title: Use Credentials with DSC Resources
77

88
> Applies To: Windows PowerShell 5.0, Windows PowerShell 5.1
99
10-
You can run a DSC resource under a specified set of credentials by using the automatic **PsDscRunAsCredential** property in the configuration.
11-
By default, DSC runs each resource as the system account.
12-
There are times when running as a user is necessary, such as installing MSI packages in a specific user context, setting a user's registry keys, accessing a user's specific local directory,
13-
or accessing a network share.
10+
You can run a DSC resource under a specified set of credentials by using the automatic
11+
**PsDscRunAsCredential** property in the configuration. By default, DSC runs each resource as the
12+
system account. There are times when running as a user is necessary, such as installing MSI packages
13+
in a specific user context, setting a user's registry keys, accessing a user's specific local
14+
directory, or accessing a network share. The **SeInteractiveLogonRight** is required, by the target
15+
machine, for any account you specify to **PSDSCRunAsCredential**. For more information, see
16+
[Account Rights Constants](/windows/desktop/secauthz/account-rights-constants).
1417

15-
Every DSC resource has a **PsDscRunAsCredential** property that can be set to any user credentials (a [PSCredential](/dotnet/api/system.management.automation.pscredential) object).
16-
The credential can be hard-coded as the value of the property in the configuration, or you can set the value to [Get-Credential](/powershell/module/Microsoft.PowerShell.Security/Get-Credential),
17-
which will prompt the user for a credential when the configuration is compiled (for information about compiling configurations, see [Configurations](configurations.md).
18+
Every DSC resource has a **PsDscRunAsCredential** property that can be set to any user credentials
19+
(a [PSCredential](/dotnet/api/system.management.automation.pscredential) object). The credential can
20+
be hard-coded as the value of the property in the configuration, or you can set the value to [Get-Credential](/powershell/module/Microsoft.PowerShell.Security/Get-Credential),
21+
which will prompt the user for a credential when the configuration is compiled (for information
22+
about compiling configurations, see [Configurations](configurations.md).
1823

19-
> [!NOTE]
20-
> In PowerShell 5.0, using the **PsDscRunAsCredential** property in configurations calling composite resources was not supported.
21-
> In PowerShell 5.1, the **PsDscRunAsCredential** property is supported in configurations calling composite resources.
22-
> The **PsDscRunAsCredential** property is not available in PowerShell 4.0.
24+
> [!NOTE] In PowerShell 5.0, using the **PsDscRunAsCredential** property in configurations calling
25+
> composite resources was not supported. In PowerShell 5.1, the **PsDscRunAsCredential** property is
26+
> supported in configurations calling composite resources. The **PsDscRunAsCredential** property is
27+
> not available in PowerShell 4.0.
2328
24-
In the following example, `Get-Credential` is used to prompt the user for credentials.
25-
The **Registry** resource is used to change the registry key that specifies the background color
26-
for the Windows command prompt window.
29+
In the following example, `Get-Credential` is used to prompt the user for credentials. The
30+
**Registry** resource is used to change the registry key that specifies the background color for the
31+
Windows command prompt window.
2732

2833
```powershell
2934
Configuration ChangeCmdBackGroundColor
@@ -60,6 +65,6 @@ $configData = @{
6065
ChangeCmdBackGroundColor -ConfigurationData $configData
6166
```
6267

63-
> [!NOTE]
64-
> This example assumes that you have a valid certificate at `C:\publicKeys\targetNode.cer`, and that the thumbprint of that certificate is the value shown.
65-
> For information about encrypting credentials in DSC configuration MOF files, see [Securing the MOF file](../pull-server/secureMOF.md).
68+
> [!NOTE] This example assumes that you have a valid certificate at `C:\publicKeys\targetNode.cer`,
69+
> and that the thumbprint of that certificate is the value shown. For information about encrypting
70+
> credentials in DSC configuration MOF files, see [Securing the MOF file](../pull-server/secureMOF.md).

0 commit comments

Comments
 (0)