Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Alternating a Variable Value

$
0
0

I’m generating a CSV file of users and AD Group memberships. One requirement is for every user to be part of a particular applicaiton. The application has 2 AD groups – one for each datacenter…and user assignment should be on a load balanced basis. So if I process 100 users , then 50% of the users shoudl be app_group_dc1 and the rest app_group_dc2.

Is there any way of generating this?

$PSobject = New-Object PSObject -Property @{ SamAccountName = $ADObject.SamaccountName ObjectClass = $ObjectClass AppGroup = "DC_1_APPUSERS" Group = $group } 

The “AppGroup” line above – is there any way that can be:

AppGroup = “DC_1_APPUSERS” or “DC_2_APPUSERS”

submitted by /u/bapesta786
[link] [comments]

The post Alternating a Variable Value appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images