Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to determine if a username is a group or a user in powershell

$
0
0

I am working on a script to add a SharePoint user policy for a claims based web application. The username has to be claims encoded, which differs for users accounts and groups. If the username is passed as

[string] $username

How can I determine if the string is a user account or a group? I have not found anything short of a brute force AD search for the username with a group filter.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>