Populate attribute with list of Server Names

I am trying to build a Workflow for User Logon restrictions. I need the workflow to search for servers that exist in different groups, OU's or managed Unit. If necessary i can consolidate them into 1. The issue is I need to then populate the user attribute "userWorkstation" found in another search  with all the server names found with a Semicolon in between each.

Example:

Server1;Server2;Server3;   etc...

Help?

Parents
  • Vincent,

    I'm not 100% sure on what you are trying to accomplish from your description, but something like this might help:

    function searchForComputers($Request)
    {
        $container = "OU=Domain Controllers,DC=domain,DC=local"
    
        $foundComputers = Get-QADComputer -SearchRoot $container
    
        $stringArray = @()
    
        foreach($foundComputer in $foundComputers)
        {
            $stringArray += $foundComputer.Name
        }
    
        $output = [string]::Join(";",$stringArray)
    
        $output
    
    }

Reply
  • Vincent,

    I'm not 100% sure on what you are trying to accomplish from your description, but something like this might help:

    function searchForComputers($Request)
    {
        $container = "OU=Domain Controllers,DC=domain,DC=local"
    
        $foundComputers = Get-QADComputer -SearchRoot $container
    
        $stringArray = @()
    
        foreach($foundComputer in $foundComputers)
        {
            $stringArray += $foundComputer.Name
        }
    
        $output = [string]::Join(";",$stringArray)
    
        $output
    
    }

Children