[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1176
  • Last Modified:

searching for exchangeguid in powershell

I am trying to search for a mailbox by using the GUID that is provided to me in an error from MOM.
I am getting an error in powershell but I do not know why.  Here is the following:

[PS] R:\>get-mailbox -resultsize unlimited -domaincontroller somedomain.com |where-object {$_.exchangeguid -eq 027293e0-2600-40d2-96b5-d8b0a7ce63dd}
Unexpected token '2' in expression or statement.
At line:1 char:130
+ get-mailbox -resultsize unlimited -domaincontroller stl-dcna-04.na.erac.com
where-object {$_.exchangeguid -eq 027293e0-2600-40d2- <<<< 96b5-d8b0a7ce63dd}

Can anyone tell me what I am doing wrong?
0
lardo
Asked:
lardo
1 Solution
 
BSonPoshCommented:
027293e0-2600-40d2-96b5-d8b0a7ce63dd needs to be in ""
when you do -eq it does and EXACT match

Try
[PS] R:\>get-mailbox -resultsize unlimited -domaincontroller somedomain.com |where-object {$_.exchangeguid -eq "027293e0-2600-40d2-96b5-d8b0a7ce63dd"}
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now