Jump to content

Recommended Posts

Posted
Can anyone help me with some powershell stuff. Basically, have set up the online mail server and imported users into it with a CSV file. I put a column in there called "CurrentAttribute1" which split the users into Staff/pupil/admin etc, and now I want to set up a group based on these attributes. Trouble is, it only lets me do it from powershell cmdlets. I can't even find the get cmdlet to return the full list of imported attributes, let alone start to build a group with them. Anyone got any ideas? Sorry if this is posted in the wrong forum, btw!
Posted

Hi

 

How did you import the users? Powershell?

 

What group do you want to setup? DL? SG? and do you want to assign this group a custom attriubute?

 

Sukh

Posted

Imported them using the import function on the system portal. I assigned each user a custom attribute denoting staff/pupil/admin/etc, and want to set up a distribution list based on these attributes, so I really want a script which will assign all users to a certain DL based on this switch, so to speak. Does that make sense?

Cheers for the quick response, btw!

Posted

Either of these should do it...

 

New-DynamicDistributionGroup -Name "All Staff" -IncludedRecipients MailboxUsers -ConditionalCustomAttribute1 Staff

 

New-DynamicDistributionGroup -Name "All Staff" -RecipientFilter { (RecipientType -eq 'UserMailbox') -and (CustomAttribute1 -eq 'Staff') }

 

e.g.

 

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

New-DynamicDistributionGroup -Name "All Staff" -RecipientFilter { (RecipientType -eq 'UserMailbox') -and (CustomAttribute1 -eq 'Staff') }

Remove-PSSession $Session

 

Links

http://help.outlook.com/en-us/140/dd264649.aspx

http://help.outlook.com/en-us/140/dd264647.aspx

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 43 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...