Compare two dynamic variables

Hello,
I'm struggeling comparing two variables against each other as seen below. I have some AD-group names in a csv file, and I have a  variable($getGroup) with results from a Get-ADGrup-query.
I'd like to filter out the groups of the csv-file from the variable, so "$getGroup" in this example should end up empty. 
In the example below, the return is the two groups, so it doesn't get filtered out. How can I do that?
Contents of exclude.csv:
Name,Comment
"AD,Group1","Some comment"
"AD*Group2","Some comment"
$excluded = Import-CSV 'C:\temp\exclude.csv'
$getGroup = Get-ADGroup -Filter * | Where-Object {$_.Name -like '*,*' -or $_.Name -like '*#*' -or $_.Name -like '*+*' -or $_.Name -like '*"*' -or $_.Name -like '*\*' -or $_.Name -like '*<*' -or $_.Name -like '*>*' -or $_.Name -like '*;*'}
#At this point $getGroup returns two groups; AD,Group1 and AD*Group2
$getGroup = $getGroup | Where-Object {$_.Name -notlike $excluded.Name}
$getGroup

Hi,
If you have actual group names in your input CSV, try this:
$excludedGroups = Import-Csv .\excludeGroups.csv | Select -ExpandProperty Name
Get-ADGroup -Filter * -SearchBase 'OU=Testing,DC=domain,DC=com' |
Where { $excludedGroups -notcontains $_.Name }
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • Compare two complex variables with BPEL ?

    Hi,
    I would like to compare 2 csv files with BPEL, with specific rules. For example, I would like to check that for each row : "Value of Field1 of File1" has less than a 10% difference with "Value of Field1 of File2"
    I can successfully retrieve the content of the files, thanks to the following thread : Help! Three questions about FileAdapater. . Now the files are in 2 variables.
    What is the right method to compare the variables, row by row with this kind of specific validation rules ? Should I handle it with a Java call ? Especially, where should be the loop on rows : in BPEL (if so : how ?) or Java ?
    Regards,
    Alexandre
    Message was edited by:
    Alexandre

    I suggest having a look at the Array sample (orabpel\samples\tutorials\112.Arrays)
    that shows how to loop through an array.
    Whether to do this in BPEL of Java depends on a lot of circumstances, but I suggest giving this a try first.

  • Dynamic variable issue

    i have two dynamic variables latest week,latest week-1
    when i am applying the filter condition: between latest week and latest week-1
    (latest week,latest week -1 both are dynamic variables)
    if i click on result it's showing no resultent data for current applied fiter
    thanks
    bethamsetty

    Please Conform below steps.
    The variable name is latestweek-1 ?
    Please test dynamic variable in IntBlock whether are getting value or not? -- Do you know how to test variable in intblock.., If yes check first result.
    Please follow the my blog and recreate new dynamic variable and follow the steps.
    Note: Did you get any error?
    Hope this help's
    Thanks,
    Satya

  • Displaying dynamic variable text in WEBi

    Hi I would like to populate data to my dashboard using a Webi report. My datasource is BI query.
    In this query I have two dynamic variable values where the user needs to enter the starting period & ending period
    If the user enter starting period as  2009 & ending period as 2010 it should display the text as Dynamic year 2009 to 2010
    as below
    Region -
    Dynamic year 2009 t 2010
    WW_______41
    if the user enter the values starting period as  2008 & ending period as 2011 it should display the text as Dynamic year 2008 to 2011
    IThe result was successful in the BI query but when I us eteh same query in Webi & when I run the webi report it prompts me to enter the starting period & ending period values & when I execute it it displays the values for this period but not showing the text it dispaying the technical name instead of teh dynamic text like below
    Region -
    &CRMTFY&CRMTEY&
    WW_______41
    How can I get these dynamic text
    Thanks

    Hi Sirisha,
    Use User responce Function for diaplying the input data as
    User Responce('(dataprovider(any data object name)), 'prompt name')
    In the 1st parameter try to use diff functions available in BO instead of hrdcoding data provider name.
    Cheers,
    Suresh A.

  • Compare two structures dynamically.

    Hi,
    How to compare two structures dynamically.
    Thanks,
    Ram.

    Hi,
    WE can compare two structures like they are eual if their elementary components are equal.
    If the structures are unequal, we can find which is longer and which is shorter.
    Regards,
    jaya

  • How to compare two PLSQL tables dynamically.

    Hi,
    Can you any body help for the following scenario,
    I have two PLSQLtables with same structure ,Each PLSQL table contains more than 100 columns.
    Now I want to compare content of the two PLSQL tables column wise.
    I Knew allready one method like below
    FOR I IN 1..100
    LOOP
    IF PLSQL_1_TAB(I).ACCT_NO = PLSQL_2_TAB(I).ACCT_NO THEN
    INSERT INTO …....
    END IF;
    END LOOP;
    is there any method to compare two PLSQL tables dynamically
    Edited by: RAVI KUMAR.T.V. on May 5, 2011 11:51 PM

    Hi Saubhik,
    Thanks for your reply..
    See the below code..
    DECLARE
    CURSOR cur_emp IS
    SELECT *
    FROM emp
    WHERE job = 'MANAGER';
    TYPE typ1 IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER;
    v_pl_old typ1;
    v_pl_new typ1;
    BEGIN
    OPEN cur_emp;
    FETCH cur_emp INTO v_pl_old(1);
    CLOSE cur_emp;
    UPDATE emp SET comm = comm+1000 WHERE hiredate < '01-MAY-1981' AND job = 'MANAGER';
    COMMIT;
    OPEN cur_emp;
    FETCH cur_emp INTO v_pl_new(1);
    CLOSE cur_emp;
    IF v_pl_old(1) = v_pl_new(1) THEN
    DBMS_OUTPUT.PUT_LINE('Latest comm not yet Updated');
    ELSE
    DBMS_OUTPUT.PUT_LINE('Latest comm Updated');
    END IF;
    END;
    When the above code is executed iam getting the following error :
    ORA-06550: line 19, column 19: PLS-00306: wrong number or types of arguments in call to '='
    ORA-06550: line 19, column 4: PL/SQL: Statement ignored
    Here in the example I have taken the standard EMP table, but
    actually, Iam having a bigger table with 90 columns of different datatypes,
    in which some of the columns gets updated after some UPDATE statements executed based on some conditions.
    Now, my requirement is to compare the values of each and every column in the table before and after the execution of the UPDATE statements,
    and to insert the modified values only along with the primary key column value into in a new table of similar structure.
    If I write the code (to compare the values of each and every column in the table, and if the value is modified then insert that value along with the primary key value into a different talbe) then as the table is having many columns (90), the code becomes lengthy..
    Is there any alternative method which does the same with shorter code.
    Can you please give me an idea/sol. to meet my requirement.
    Thanks..
    Edited by: RAVI KUMAR.T.V. on May 9, 2011 2:43 AM

  • How to COmpare two variable in BPEL

    Hi ,
    I have two compare two variable ( EIN field ) one from input variable of a BPEL process and other one the output variable of a invoke .
    My requiremet is like this :
    If the the value of both EIN field is same then I have to assign Name field of Invoke output parameter to Output variable of BPEL process .
    If the value doesn't match then i have to assign ' No Data Exist ' expression to Output variable of BPEL process .
    How can i do this .
    Please help me regarding this as early as possible .

    You can do this in a switch statement. Perform a comparision to check if the values are the same, if case is not important (because users will enter anything) wrap the code in a case expression, e.g. upper(user_date) = upper(file_data)
    What version of SOA Suite and JDev are you using. Make sure that these versions are in sync.
    cheers
    James

  • Dynamic variable as a path problem.

    Hi,
    I’ve established that I needed a path
    /flashcontent/screens.swf to use with loadmovie like so,
    loadMovie(“/flashcontent/screens.swf”,_root.Empty_MC);
    and this works. What I wanted to do was use a variable in my path
    like this…
    varpath = “/flashcontent/”;
    loadMovie(varpath+”screens.swf”,_root.Empty_MC);
    …this works fine!
    What doesn’t work is if I use _root._url and make it
    more dynamic. I split the path down to just the
    “/flashcontent/” and made varpath equal that.
    varpath = thesplitDownpath;
    loadMovie(varpath+”screens.swf”,_root.Empty_MC);
    I have traced to see what the differences are but the
    variables are the same i.e. both strings, char length the same and
    also made two different variables and compared the paths to see if
    they equalled each other and that was true.
    I must be missing something here!
    Thanks in advance for any help on this matter.
    Cheers Simon.

    Sorry Kglad I'm being a bit of a numpty here and I don't know
    what you mean?
    Are you asking if it's a string literal or a String object I
    working with? If thats the case then I think at a guess it's a
    string literal!!!

  • How to compare two datetimes in BPEL?

    Hi, All,
    I need compare two datetimes in a switch activity, but can't find any function for it.
    My switch activity like this:
    case date1>date2:
    do something;
    otherwise:
    do something;
    There's no such function in "Date Functions" and can't find such function in xpath.
    BTY, there's no function to make a time duration(by minus one date from another?..so this back to the data compare issue ).
    Thanks.

    Hi,
    Logical function such as greater/less than function can be used to compare two dates as same as comapring two numbers.
    Ex: If your receive variables contains two data elements as date1 and date2 then you can use below format in switch condition.
    XpathXpression(date1) > XpathXpression(date2)
    hope it will help you.

  • Compare two fields in bex

    Hi Experts,
    I want to compare two characteristics in bex. Is it possible to do in BEx ? If yes, how can i do it.
    If char A is equal to char B, display value of this key figure other wise display value of this key figure.

    Hi
    try this out:
    1) create 2 variables with Processing Type : Replacement Path and select the charc required.
    2) create 2 formula key figs. taking values from 2 diff. variables.
    3) include the variables into the formula key figs. created above respct. and the compare them.
    Hope it will resolve ur issue.
    Thanks,
    Jitender
    Edited by: Jitenderkumar Danduvia on Mar 13, 2010 7:49 AM

  • Compare two rows in a same table

    Dear all
    I need to compare two rows in the same table, I dont know hoe to do it in pl/sql. Some one please help me on this.
    example:
    tr br price
    xya0001 ama7 12
    xya0003 ama6 14
    xya0004 ama7 16
    in the table tr is a unique value for each row, I need to compare price column and see whether the first value is less or greater than the next value and, if it is greater put the corresponding br value to a variable and if it is smaller put the corresponding br value to another variable. I dont know a method to do it, as I'm new to pl/sql. Some one please help me in this

    not sure what you intend to do as you have mentioned that "TR" is unique and you just want to compare each record with just the next record. Hope below query helps. The value "G" or "L" in flag would indicate if the current records price is greater than or less than the price in next record.
    select tr,br,price,col4, case when price> col4 then 'G'  when price< col4 then 'L' end flag from (
    select tr,br,price,lag(price,1,0) over(order by tr) col4 from testcomp
    )

  • Dynamic Variable Names

    Okay, I just need to figure out how to make dynamic variable
    names. In this case, I have a loop, and inside the loop I need to
    create a new array for every iteration of the loop. Something like
    <cfloop from="0" to="10" index="i">
    <cfset LoopArray#i# = Some Value>
    </cfloop>
    But that doesn't work. How can you make dynamic variable
    named? I think it's probably something to do with evaluate or DE,
    but I don't know how to use them, and the livedocs make no sense to
    me. Thanks!

    On Thu, 22 May 2008 17:14:42 +0000 (UTC), kenji776 wrote:
    > Thank you both for your replied, I did manage to find a
    solution (the same one
    > posted by JR "Bob" Dobbs). Pretty much just looks
    like...
    >
    >
    > <cfloop from="1" to="3" index="i">
    > <cfset LinkResults["#i#"][1] = "Player 1's Move
    ID">
    > <cfset LinkResults["#i#"][2] = "Player 2's Move
    ID">
    > <cfset LinkResults["#i#"][3] = "Damage to player
    1">
    > <cfset LinkResults["#i#"][4] = "Damage to player
    2">
    > </cfloop>
    From your values, you don't want a two-dimensional array
    (which although
    you're actually building LinkResults as a struct, with the
    sequential
    numeric keys, it's basically an array), you want an array of
    structs, eg:
    LinkResults
    .player1.moveId
    LinkResults.player1.damage
    What is "i" actually counting through? IE: from 1-3 things...
    which are...
    what?
    Adam

  • Dynamic Variables and New-Object - in a GUI

    so, i have not found anything that i can parlay into a solution for what i am attempting to do.  
    Basically i am using powershell to build a GUI to manage websites on various servers.  
    in a nutshell:
    - i have an array with the servers i want to query
    - a foreach loop gets me the site names for each server (number of sites can vary on a server).
    - need put checkboxes on a GUI for every site to do something (25-30 sites across 8 servers).
    currently i am passing the $dir.name variable to a function that will create the new variable using this command:
    $pName = $dir.name New-variable -name $pName -value (New-Object System.Windows.Forms.CheckBox)
    $pName.Location -value (New-Object System.Drawing.Size(10,$i))
    $pName.Size -value (New-Object System.Drawing.Size(100,20))
    $Pname.Text -value $dir.name
    $groupBox.Controls.Add($pName) 
    Problem is i am not able to do anything with my newly created variable.  I am trying to use the following code to position the new checkbox but i get nothing (same for text, size, etc.)  I am not seeing any errors, so i don't know what i have going
    wrong.  
    is this even possible?
    I am able to create static checkboxes, and i can create dynamic variables.  But i can't mix the two...

    Here is how we normally use listboxes to handle form situations like this one.  The listboxes can automatically select subgroups.
    The hash of arrays can be loaded very easily with a script or the results of the first list can be used to lookup and set the contents of the second.
    Notice how little code is actually used.  This is all of the setup code needed aside from the from definition:
    $FormEvent_Load={
    $global:serversToSites=@{
    Server1=@('S1_SITE1','S1_SITE2','S1_SITE3')
    Server2=@('S2_SITE1','S2_SITE2','S2_SITE3')
    Server3=@('S3_SITE1','S3_SITE2','S3_SITE3')
    $listbox1.Items.AddRange($serversToSites.Keys)
    $listbox1_SelectedIndexChanged={
    $listbox2.Items.Clear()
    $listbox2.Items.AddRange($global:serversToSites[$listbox1.SelectedItem])
    $listbox2_SelectedIndexChanged={
    [void][System.Windows.Forms.MessageBox]::Show($listbox2.SelectedItem,'You Selected Site')
    Here is the complete demo form:
    [void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
    [void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
    [System.Windows.Forms.Application]::EnableVisualStyles()
    $form1 = New-Object 'System.Windows.Forms.Form'
    $listbox2 = New-Object 'System.Windows.Forms.ListBox'
    $listbox1 = New-Object 'System.Windows.Forms.ListBox'
    $buttonOK = New-Object 'System.Windows.Forms.Button'
    $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
    $FormEvent_Load={
    $global:serversToSites=@{
    Server1=@('S1_SITE1','S1_SITE2','S1_SITE3')
    Server2=@('S2_SITE1','S2_SITE2','S2_SITE3')
    Server3=@('S3_SITE1','S3_SITE2','S3_SITE3')
    $listbox1.Items.AddRange($serversToSites.Keys)
    $listbox1_SelectedIndexChanged={
    $listbox2.Items.Clear()
    $listbox2.Items.AddRange($global:serversToSites[$listbox1.SelectedItem])
    $listbox2_SelectedIndexChanged={
    [void][System.Windows.Forms.MessageBox]::Show($listbox2.SelectedItem,'You Selected Site')
    $Form_StateCorrection_Load=
    #Correct the initial state of the form to prevent the .Net maximized form issue
    $form1.WindowState = $InitialFormWindowState
    $form1.Controls.Add($listbox2)
    $form1.Controls.Add($listbox1)
    $form1.Controls.Add($buttonOK)
    $form1.AcceptButton = $buttonOK
    $form1.ClientSize = '439, 262'
    $form1.FormBorderStyle = 'FixedDialog'
    $form1.MaximizeBox = $False
    $form1.MinimizeBox = $False
    $form1.Name = "form1"
    $form1.StartPosition = 'CenterScreen'
    $form1.Text = "Form"
    $form1.add_Load($FormEvent_Load)
    # listbox2
    $listbox2.FormattingEnabled = $True
    $listbox2.Location = '237, 26'
    $listbox2.Name = "listbox2"
    $listbox2.Size = '120, 134'
    $listbox2.TabIndex = 2
    $listbox2.add_SelectedIndexChanged($listbox2_SelectedIndexChanged)
    # listbox1
    $listbox1.FormattingEnabled = $True
    $listbox1.Location = '13, 26'
    $listbox1.Name = "listbox1"
    $listbox1.Size = '120, 134'
    $listbox1.TabIndex = 1
    $listbox1.Sorted = $true
    $listbox1.add_SelectedIndexChanged($listbox1_SelectedIndexChanged)
    # buttonOK
    $buttonOK.Anchor = 'Bottom, Right'
    $buttonOK.DialogResult = 'OK'
    $buttonOK.Location = '352, 227'
    $buttonOK.Name = "buttonOK"
    $buttonOK.Size = '75, 23'
    $buttonOK.TabIndex = 0
    $buttonOK.Text = "OK"
    $buttonOK.UseVisualStyleBackColor = $True
    #Save the initial state of the form
    $InitialFormWindowState = $form1.WindowState
    #Init the OnLoad event to correct the initial state of the form
    $form1.add_Load($Form_StateCorrection_Load)
    #Clean up the control events
    $form1.add_FormClosed($Form_Cleanup_FormClosed)
    #Show the Form
    $form1.ShowDialog()
    You can easily substitute  CheckedListbox if you like checkboxes.
    ¯\_(ツ)_/¯

  • Is it possible to compare two parameters type dateTime in switch- component

    Hello,
    i have a synchronouse prozess with one switch component. In the switch component i want to compare to parameters type dateTime. While execute the prozess alwayse the <otherwise>- sector is executed, but never the sector with the condition. But the condition is fulfilled.
    Can it be, that a comparison in a switch-component doesn't work while using two parameters with type dateTime?
    If it is so, has anybody an idea, how to compare two dateTimes without using the character dateTime?
    I'll be very happy about a helpfull advice.
    Thanks and regards,
    rala

    Hi Rala,
    this example works perfectly for me.
    IMHO doesn't matter how to assign values to dateTime variables.
    <scope name="Scope_timeDate">
    <variables>
    <variable name="aktCas" type="xsd:dateTime"/>
    <variable name="casDuration" type="xsd:dateTime"/>
    </variables>
    <sequence name="Sequence_1">
    <assign name="Assign_datesTimes">
    <copy>
    <from expression="xp20:current-dateTime()"/>
    <to variable="aktCas"/>
    </copy>
    <copy>
    <from expression='"2002-05-30T09:00:00"'/>
    <to variable="casDuration"/>
    </copy>
    <copy>
    <from expression="'before'"/>
    <to variable="rtn"/>
    </copy>
    </assign>
    <switch name="Switch_1">
    <case condition="bpws:getVariableData('aktCas') &gt; bpws:getVariableData('casDuration')">
    <assign name="Assign_ok">
    <copy>
    <from expression='"IF"'/>
    <to variable="rtn"/>
    </copy>
    </assign>
    </case>
    <otherwise>
    <assign name="Assign_otherwise">
    <copy>
    <from expression='"otherwise"'/>
    <to variable="rtn"/>
    </copy>
    </assign>
    </otherwise>
    </switch>
    </sequence>
    </scope>
    Regards,
    Ivan

  • How can I compare two summary field in cross-tab?

    <p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab?  I have following cross-table:</p><p>Type          Sector1     Sector2    Sector3       Total </p><p>Outlook         10            11           9              30         </p><p>Target            5              3           1               9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>

    Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
    1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
    2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
    For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
    Best,
    Alexander

Maybe you are looking for

  • Printing a list of all the files in a folder

    I have a bunch of files in a folder on an external drive.  I frequently add and/or delete files from the folder and would like to print out a simple up-to-date list of the names of the files in the folders on a frequent basis.  In am using Mac OS 10.

  • Adobe photoshop elements 11 stopped working.

    Photoshop elements 11 suddendly stopped working. I have worked with the program the last couples of years and never had a issue until now. I have not change any settings in my computer. Windows 7 (64). I have read in other forums, it may be caused by

  • CRM order pricing is gets overwritten

    Dear SDN team, I need your help on the below CRM pricing issue We see that the Gross value in CRM order gets determined correctly in CRM system during order creation . Once the order flows into SAP R/3 system the Pricing is getting re-determined as p

  • Actualice mi ipod y se apago

    actualice mi ipod anoche y se apago luego no enciende

  • Mixer controller under 1000$

    please  what  is a good 8-12 channel  mixer controller for logic and protools and possibily stand alone mixer also for less then 1000$,