How would I write this

rated by 0 users
This post has 2 Replies | 1 Follower

Top 100 Contributor
Posts 17
danarstevenson Posted: 03-12-2012 2:20 PM

{msExchHideFromAddressLists="True"}

The attribute has a true, false or not set option.  How would I set it to true ?

 

I dont think I understand the Boolean options yet.

 

Thanks
Dana

Top 10 Contributor
Posts 296
Microsoft MVP
Top Contributor

Assuming that you have an object representing the user

$user.msExchHideFromAddressLists=$true

should work

Top 100 Contributor
Posts 17

Here is how I ended up writing the change.  I did not know to put the $ in front of the true to get the option selected.

 

# ======================================================
#
# This script is designed to change a custom attribute on a Group
# From a csv file              Don't Change
# To get <Not Set> just type in Not for the Boolean entry or anything else invalid
#
# ======================================================

cls
$AD=",OU=Test,DC=domain"
$CN="CN="
$Domain="domain.com"


Import-CSV "C:\Scripts\test\test.csv" | % {
            $Name=$_.Name
            $Iden=$CN+$Name+$AD
            Set-QADGroup -Identity $Iden -ObjectAttributes @{msExchHideFromAddressLists=$Not}
}

 

Thanks for the response

Page 1 of 1 (3 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.