Is there anyway to pass a GSS Client Name to a script that runs a powershell file?
Are there variables in the console that can be used in scripting?
For example this is something i am trying to achieve.
".\file.ps1 computername" (where computername would be the client name in the gss console that you are running the script on.)
file.ps1 contents below..
param ($PC_Name)
$DomainNameA = 'domainA'
$DomainNameB = 'domainB'
$GroupName = 'my.group'
$GetMemberObject = Get-ADComputer -Identity $PC_Name -server $DomainNameB
$GetGroupObject = Get-ADGroup -Identity $GroupName -server $DomainNameA
Add-ADGroupMember -identity $GetGroupObject -members $GetMemberObject -server $DomainNameA