[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Compare Get-ReceiveConnector Permissions Groups against variable

Posted on 2014-08-18
7
Medium Priority
?
135 Views
Last Modified: 2014-11-13
HI, Exchange Permissions Groups set on a HT table are stored within a Noteproperty. To extract this data requires a hash table.

How can I compare each HT connectors Exchange groups, against a predefined value, to see it correlates as expected?

$Hash = @{}
$exsrv = $env:computername
Get-ReceiveConnector -Server $exsrv | Select-Object name, permis* | % {$Hash [$_.Name] = $_.PermissionGroups}
$Hash

Open in new window

0
Comment
Question by:patelbg2001
  • 3
  • 2
5 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 1500 total points
ID: 40268189
against a predefined value
What you have to compare against? is it a csv file with connector and permission details?

If yes.. check if the file is in the format of the result file of following command..
Get-ReceiveConnector -Server ServerName | Select-Object name, permis* | export-csv c:\temp\report.csv -nti

Open in new window

0
 
LVL 6

Author Comment

by:patelbg2001
ID: 40268249
no, I don't want it to go to a text file, say for example $g = " ExchangeServers",

foreach ($connector)
if ($connector.value -ne $g) {
........
}

Open in new window

0
 
LVL 40

Expert Comment

by:Subsun
ID: 40268292
If $g contains only single value..
$Hash = @{}
$exsrv = $env:computername
Get-ReceiveConnector -Server $exsrv | Select-Object name, permis* | % {$Hash [$_.Name] = $_.PermissionGroups}

$g = "ExchangeServers"

ForEach ($connector in $Hash.Keys){

  if ($connector -ne $g)  {

  #Do something

  }

}

Open in new window


If $g is a array (more than one values)..
$g = "ExchangeServers","ExchangeServers1","ExchangeServers2"

ForEach ($connector in $Hash.Keys){

  if ($g -notcontains $connector)  {

  #Do something

  }

}

Open in new window

0
 
LVL 6

Author Comment

by:patelbg2001
ID: 40432219
I've requested that this question be deleted for the following reason:

Not valid question
0
 
LVL 40

Expert Comment

by:Subsun
ID: 40432220
@patelbg2001, The Answer provided should work. I don't understand what you mean by 'Not valid question'. Could you please clarify?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video discusses moving either the default database or any database to a new volume.
Suggested Courses

834 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