# Creating new pswa Authorization rule

**URL:** <https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979>\
**Category:** PowerShell Help\
**Created:** [October 17, 2013, 8:51pm UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979 "2013-10-17T20:51:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amandeep-bhatia](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@amandeep-bhatia](https://forums.powershell.org/u/amandeep-bhatia)\
**Post date:** [October 17, 2013, 8:51pm UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/1 "2013-10-17T20:51:40Z")

</div>

Hello,

I have configured the pwsa on a windows 2012 server. The virtual directory and everything got installed properly and I can browse to the Windows Powershell Web Access Login page.  
But I need to create the authorization rule before I can login.  
Running below cmdlet gives the error:  
**Add-PswaAuthorizationRule â€“UserName Contoso\JSmith -ComputerName Contoso\_214 -ConfigurationName NewAdminsOnly**

_Add-PswaAuthorizationRule : The specified directory service attribute or value does not exist.  
At line:1 char:1_

 
_- Add-PswaAuthorizationRule â€“UserName Contoso\JSmith -ComputerName Contoso\_214 -ConfigurationName NewAdminsOnly
-_ 

_```auto
  + CategoryInfo : InvalidOperation: (:) [Add-PswaAuthorizationRule], COMException
  + FullyQualifiedErrorId : AddRuleError,Microsoft.Management.PowerShellWebAccess.AddPswaAuthorizationRuleCommand</em></em>_

_```_

 

_Please help! NewAdminsOnly config has been already created._

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 18, 2013, 2:14am UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/2 "2013-10-18T02:14:19Z")

</div>

Hey Amandeep!

Are you do the Add-PSWAAuthorizationRule using PowerShell Remoting? There is a multi-hop issue. Also, the computer name should be fully qualified.

Try to fully qualify the computername – you can also create a couple of test rules to narrow down the issue such as Add-PSWAAuthorizationRule -Username \* -ComputerName MyComp.Domain.Pri -ConfigurationNAme \* – Of course, you will want to delete these test rules, but this cna help see exactly where the problem is.

Let me know if this helped!

Jason

---

<div class="post-metadata">

**Author:** ![amandeep-bhatia](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@amandeep-bhatia](https://forums.powershell.org/u/amandeep-bhatia)\
**Post date:** [October 19, 2013, 5:37pm UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/3 "2013-10-19T17:37:01Z")

</div>

Ok, first of all, thanks for replying. Here is what i am trying.

I want to automate some stuff with powershell such as few members whom i give access could run those scripts using powershell web access(as they are the MAC users and not windows.). For this, i am setting a VM for windows 2012 standard edition server(It is not 2012 R2) with all my script modules installed there.

As you suggested, i ran script with -UserName \* and it worked and created the rule. However, it did not allow me to login giving authorization failure with that domain user for which i created the rule.

Then, i created the rule with below command:  
Add-PswaAuthorizationRule â€“UserName \* -ComputerName \* -ConfigurationName \*

Giving access to everyone with every configuration. This allowed the domain user to login through the web console and issue commands.

So, now i just need to see how can i give specific rights to specific users. And why the rule creation with specific username is failing. Please let me know if you have any further suggestions. Again, thanks for your anticipation.

Thanks,  
Aman.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 20, 2013, 2:53am UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/4 "2013-10-20T02:53:43Z")

</div>

Hi Aman!

Check a couple of things - First - if the user is not an administrator, you will need to add them to the target remote servers local group “Remote Management Users”. - Or create a new AD group and that group so you can easily add users.

Here is an example of my rule for a regular user that has been added to that group.

PS C:\> Add-PswaAuthorizationRule -UserName Company\Bobs -ComputerName s1.Company.Pri -ConfigurationName \*

Bobs is a regular user  
S1.Company.Pri is the remote computer I want Bobs to be able to use.

Let me know how it goes!

Jason

---

<div class="post-metadata">

**Author:** ![amandeep-bhatia](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@amandeep-bhatia](https://forums.powershell.org/u/amandeep-bhatia)\
**Post date:** [October 20, 2013, 10:46pm UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/5 "2013-10-20T22:46:43Z")

</div>

Thanks, Still struggling with it. Everything works with \* for a username but soon as i give specific user i get the error. Also tried that User as Admin on required machine on which access is required.

Just a blind guess, do I need to be a domain admin in order to run this command?Currently I am not.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [October 23, 2013, 11:18am UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/6 "2013-10-23T11:18:53Z")

</div>

Are you standing at the server or using PowerShell remoting?

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:56pm UTC](https://forums.powershell.org/t/creating-new-pswa-authorization-rule/1979/7 "2024-05-16T20:56:56Z")

</div>


