?
Solved

Powershell quirks - have to use Guid instead of friendly identity names?

Posted on 2007-07-20
5
Medium Priority
?
703 Views
Last Modified: 2007-10-18
This may just be how powershell works and behaves, or maybe we have something wierd/wrong...

Is there a reason why we need to use the physical Guid on a lot of the PowerShell commands instead of using their friendly names?

For example if I want to get the permissions on a Storage Group with the Get-Adpermissions cmdlet, I need to first issue a get-storagegroups | fl to pluck out the Guid of my storage group.  I then need to pass that guid into the Get-Adpermissions cmdlet instead of just using the identity listed..

Example chain..

Get-AdPermissions "ExchStore\Tier1 SG"  -> returns ExchStore\Tier1 SG was not found.
Get-StorageGroup "Tier1 SG" | fl -property Guid  ->  Returns the guid string -> Copy to clipboard
Get-AdPermissions <paste Guid string>  ->  Returns expected results.

Why can I use the "Tier1 SG" on a get-storagegroup, but not on a Get-AdPermissions?  I've run into this with a lot of the cmdlets for Exchange 2007 and it's been driving me batty.
0
Comment
Question by:qsnow
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:kristinaw
ID: 19532754
get-adpermission -identity "first storage group"
works like a champ for me. of course, i have a 2 'first storage group' instances, so it's pulling both of them. i'll have to play with it a bit and see if i can get it to pull just for one server. i tried 'servername\first storage group' and it didn't like that.

kris.
0
 
LVL 1

Author Comment

by:qsnow
ID: 19532848
Wouldn't you expect, that if the 'identity' tag in a get-storagegroup shows "<server>\<group>" that would be something valid to pass to other commands in it's entirety?
0
 
LVL 22

Accepted Solution

by:
kristinaw earned 2000 total points
ID: 19532869
i got it to work like this:

get-storagegroup -identity "SERVERNAME\First Storage Group" | get-adpermission
0
 
LVL 22

Expert Comment

by:kristinaw
ID: 19576704
gsnow, any more ?'s?

kris.
0
 
LVL 1

Author Comment

by:qsnow
ID: 19578677
Ack, sorry.  No that worked for me as well.  Still seems like I should be able to flat query it by the full identity that it's listed by -- but since you got the same results I did, at least nothing is wrong with my config ;-)
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This video discusses moving either the default database or any database to a new volume.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question