3 sonuçtan 1 ile 3 arası

Konu: Server 2008 R2 Ad üzerindeki User Local Admin Listesini Çıkarma

  1. #1

    Standart Server 2008 R2 Ad üzerindeki User Local Admin Listesini Çıkarma

    Merhaba

    Server 2008 r2 üzerinden user'ların hangilerinde makinları üzerinde local admin grubuna üye olduğunu ve bu listeyi nasıl öğrenebiliriz.
     

  2. #2

    Standart

    Merhaba,

    Bu script i deneyebilir misiniz?

    ' ************************************************** ************************************************** ***
    ' * *
    ' * Script name: ListLocalAdmin1.0.vbs *
    ' * Description: Lists all members of local administrators group of computers located in list *
    ' * *
    ' * Author: Konráğ Hall *
    ' * *
    ' * Platforms/Req: Windows 2000 or newer *
    ' * *
    ' ************************************************** ************************************************** ***
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objDictionary = CreateObject("Scripting.Dictionary")
    Set objNetwork = CreateObject("Wscript.Network")
    strLogFolder = "c:\Logs"
    strInputfile = "C:\Logs\Comp.txt"
    strLogfile = "c:\Logs\listlocaladmin"&date()&".log"
    strComputer = objNetwork.ComputerName
    Const ForReading = 1
    On Error Resume Next
    If ReportFileStatus(strInputfile)="False" Then
    Wscript.Echo "Input file not found"
    WScript.Quit
    End If

    If ReportFolderStatus(strLogFolder) = False Then
    objFSO.CreateFolder(strLogFolder)
    End If
    If ReportFileStatus(strLogfile)="False" Then
    Set logs = objFso.CreateTextFile(strLogfile)
    logs.close
    End If

    Set objTextFile = objFSO.OpenTextFile (strInputFile, ForReading)
    i = 0

    Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    If Not Left(strNextLine, 1) = "#" Then
    objDictionary.Add i, strNextLine
    i = i + 1
    End If
    Loop

    For Each objItem in objDictionary
    StrComputerName = objDictionary.Item(objItem)
    If DeadOrAlive(StrComputerName) = "True" Then
    Set objGroup = GetObject("WinNT://" & StrComputerName & "/Administrators,group")
    For Each objUser in objGroup.Members
    members = members & ";" & objUser.Name
    Next
    Set logs = objFso.OpenTextFile(strLogfile, 8)
    logs.writeline(" "& now() & ";"& "Alive;" & StrComputerName & members)
    logs.close
    members = " "
    Else
    Set logs = objFso.OpenTextFile(strLogfile, 8)
    logs.writeline(" "& now() & ";"& "Dead;" & strComputerName)
    logs.close
    End If
    Next
    '*****************************
    '*** Check if log file exists
    '*****************************
    Function ReportFileStatus(filespec)
    Dim fso, msg
    Set objfso = CreateObject("Scripting.FileSystemObject")
    If (objfso.FileExists(filespec)) Then
    ReportFileStatus = True
    Exit Function
    Else
    ReportFileStatus = False
    Exit Function
    End If
    End Function
    '*****************************
    '*** Check if computer is alive
    '*****************************
    Function DeadOrAlive(ComputerName)
    Set objShell = CreateObject("Wscript.Shell")
    Set objScriptExec = objShell.Exec("ping -n 2 -w 1000 " & ComputerName)

    If InStr(objScriptExec.StdOut.ReadAll, "Reply") > 0 Then
    DeadOrAlive = True
    Else
    DeadOrAlive = False
    End If
    End Function
    'Function wich returns either true or False
    Function ReportFolderStatus(folderspec)
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    If (fso.FolderExists(folderspec)) Then
    ReportFolderStatus = True
    Exit Function
    Else
    ReportFolderStatus = False
    Exit Function
    End If
    End Function
    Emre Aydın
    MVP | Office 365 | Since 2006
    MCT | Since 2005
    MCSD | Azure Solutions Architect
    MCSE | Private Cloud, Messaging, Communication, Server Infrastructure, Productivity, Platform
    MCSA | Office 365, Server 2012, Cloud Platform
    MCTS | Developing Azure Solutions, Implementing Azure Infrastructure, Architecting Microsoft Azure Solutions, SAM
    P-Seller
    Intelligent Cloud | EMS
    Web : www.mshowto.org
    Mail : emre.aydin [@] mshowto.org
    Twitter : https://twitter.com/emreaydn
    Linkedin : tr.linkedin.com/in/emreaydn

  3. #3

    Standart

    Teşekur.Listeyi çıkardım buna benzer bir sicript ile.
     

Benzer Konular

  1. GP de local admin problemi
    By SuperUser in forum Server2008
    Cevaplar: 1
    Son Mesaj: 02-24-2014, 12:02 PM
  2. Grup Policy ve local admin
    By lord_phoenix in forum Server2003
    Cevaplar: 1
    Son Mesaj: 03-30-2010, 11:54 AM
  3. Server 2003 Local Admin Password
    By aliates in forum Server2003
    Cevaplar: 2
    Son Mesaj: 12-30-2009, 02:39 PM
  4. Local Admin Grubunda unutulan usersları listeleme
    By uguryerli in forum Server2003
    Cevaplar: 1
    Son Mesaj: 02-06-2009, 02:29 PM
  5. local kullanıcıları admin yapma
    By ekinonline in forum Server2003
    Cevaplar: 1
    Son Mesaj: 03-28-2008, 01:33 PM

Yetkileriniz

  • Konu Açma Yetkiniz Yok
  • Cevap Yazma Yetkiniz Yok
  • Eklenti Yükleme Yetkiniz Yok
  • Mesajınızı Değiştirme Yetkiniz Yok
  •  
Hakkımızda
MSHOWTO, herhangi bir firma ya da kuruluş ile bağı olmayan bağımsız teknik bir topluluktur.
Sosyal Medya Linklerimiz