Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Scheduling adding computers to and from an AD security group

$
0
0

Hi All,

 

I'm looking to add a number of computers to a security group on the last Monday of every month and then remove them 2-3 days later but having a little difficulty so hoping someone can point me in the right direction,

 

I have this script to check if the day is the last Monday of the month

 

function Get-LastMondayOfMonth([DateTime] $d) {   

    $lastDay= new-objectDateTime($d.Year, $d.Month, [DateTime]::DaysInMonth($d.Year, $d.Month))

    $diff= ([int] [DayOfWeek]::Monday) - ([int] $lastDay.DayOfWeek)

 

    if ($diff-ge0) {

        return $lastDay.AddDays(- (7-$diff))

    }

    else {

        return $lastDay.AddDays($diff)

    }   

}

 

I now need to know how i pass the results of this to a workflow that already adds the computers to the correct group just that its not automated yet....

 

Thanks

 

Alex


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>