Hi, i had been researching about how to query out the AD enableRemoteControl user properties information and also set it information using powershell script for past whole week.
What I had found, using is VBScript which I do not have a good idea of how to change it to powershell script. Lately I found about powershell command, but it did not work for me. I had been also trying to solve the error, here is my script:
$objSearch = New-Object DirectoryServices.DirectorySearcher
$strADPath = 'LDAP://ou=Power Shell test ,ou= Testing OU,dc=com'
$strGeneralPSFile = "D:\Powershell for AD\general.ps1"
. $strGeneralPSFile
$objSearch.Filter = '(&(objectClass=user)(samaccountname=Noobycy))'
$objSearch.SearchRoot = $strADPath
$objSearch.PageSize = 1000
$objSearch.SearchScope = "subtree"
$objResults = $objSearch.Findall()
foreach($objResult in $objResults){
$objUser = $objResult.GetDirectoryEntry()
#I was trying to get the enableremotecontrol information, to see that whether it is disable or enable.
$objUser.InvokGet("enableremotecontrol")
#trying to set the enable remote control
#$objUser.InvokeSet ("enableremotecontrol",1)
#$objUser.setinfo()
}this is my error show for invokeGet method:
this is my error show for invokeSet method:
What I found the reason is because I did not install terminal server extension, but once i had update/install the app into the desktop, it still having this error.