Hi guys!
I am sorry formy english
there is a function:
# Script: Get-Remote-LocalAdmins.ps1
# Purpose: This script can detect the members of a remote machine's local Admins group
# Author: Paperclips (The Dark Lord)
# Email: magiconion_M@hotmail.com
# Date: Nov 2011
# Comments:
# Notes:
#
function get-localadmin {
param ($strcomputer)
$admins = $admins |? {$_.groupcomponent –like '*"Administrators"'}
$admins |% {
$_.partcomponent –match “.+Domain\=(.+)\,Name\=(.+)$” > $nul
$matches[1].trim('"') + “\” + $matches[2].trim('"')
}
}
#Usage: get-localadmin "Server FQDN"
Functionis in the fileGet-Remote-Localadmin.ps1.I aminsertitinto the profile.I opena new session
andtry to runas specifiedin the comment get-localadmin "Server FQDN" (get-localadminW7-ps.contoso.com)
andget nothing at the output