صفحه 5 از 7 اولیناولین 1 2 3 4 5 6 7 آخرینآخرین
نمایش نتایج: از شماره 61 تا 75 از مجموع 92

موضوع: بانک اسکریپت پرشین نـتـورک

  
  1. #61
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272
    عادت کنیم کاری که آغاز کردیم ادامه دهیم و نیمه کاره رها نکنیم.


    Hakimi، ARM، mahyar49 و 4 نفر دیگر سپاسگزاری کرده‌اند.

  2. #62
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272
    Submitted By: Ismael Serrano
    Changes the local Administrator password for all the computers in a specified OU.

    VBScript
    کد:
    Option Explicit
    On Error Resume Next
    
    Dim strComputer,objOU,objComputerItem
    'Change the LDAP to reflect which OU you want to affect
    Set objOU = GetObject("LDAP://OU=Computers,OU=MyOU, DC=MyDomain, DC=com")
    objOU.Filter = Array("Computer")
    
    For Each objComputerItem In objOU
        strComputer = objComputerItem.CN
        Call SubSendPing(strComputer)
    Next
    
    
    '-----------------------SUB ROUTINES------------------------------------
    
    Sub SubSendPing(strComputer)
        Dim objShell,strCommand,objExecObject,strText
        Set objShell = CreateObject("WScript.Shell")
        strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer & ""
        Set objExecObject = objShell.Exec(strCommand)
    
        Do Until objExecObject.StdOut.AtEndOfStream
            strText = objExecObject.StdOut.ReadAll()
            If Instr(strText, "Reply") > 0 Then
    '**********Write your code here to do if the computer replies to ping************            
                   WScript.Echo strComputer & " has replied."
                   Call SubChangePW(strComputer)
    '********************************************************************************
            Else
                WScript.Echo strComputer & " Could not be reached."
            End If
        Loop
    End Sub
    
    Sub SubChangePW(strComputer)
        Dim objUser
        Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
           objUser.SetPassword("P@ssw0rd1")
           WScript.Echo strComputer & " has changed admin pw."
    End Sub
    
    '-------------------------END SUBS----------------------------------------
    ************************************************** ***********************
    ************************************************** ***********************

    Submitted By: Anonymous Submission
    Changes the local Administrator password. The script should be deployed using Group Policy or through a logon script.

    VBScript
    کد:
    Set oShell = CreateObject("WScript.Shell")
    Const SUCCESS = 0
    
    sUser = "administrator"
    sPwd = "Password2"
    
    ' get the local computername with WScript.Network,
    ' or set sComputerName to a remote computer
    Set oWshNet = CreateObject("WScript.Network")
    sComputerName = oWshNet.ComputerName
    
    Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUser)
    
    ' Set the password
    oUser.SetPassword sPwd
    oUser.Setinfo
    
    oShell.LogEvent SUCCESS, "Local Administrator password was changed!"



    ARM، mahyar49، zoorba و 1 نفر دیگر سپاسگزاری کرده‌اند.

  3. #63
    نام حقيقي: +++AnathemA+++

    عضو ویژه شناسه تصویری mahyar49
    تاریخ عضویت
    May 2009
    محل سکونت
    021
    نوشته
    913
    سپاسگزاری شده
    879
    سپاسگزاری کرده
    673
    سلام
    حتما با Bitlocker ویندوز 7 کار کردید...
    عملکردش بسیار عالیه و من که خیلی ازش راضی هستم...

    اما یه باگ داره...
    اینکه وقتی شما قفل یه درایو رو باز می کنی ، برای اینکه دوباره قفل بشه سیستم باید restart بشه...
    تو اینترنت گشتم و اسکریپت و ترفندی برای اینکه آیتم lock اضافه بشه پیدا کردم...

    متن زیر را در فایل notepad کپی کنید و با پسوند reg ذخیره کنید و آنرا اجرا کنید:

    کد:
     
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\Drive\shell\Lock Drive...\command]
    @=hex(2):77,00,73,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,\
      00,6d,00,61,00,6e,00,61,00,67,00,65,00,2d,00,62,00,64,00,65,00,2e,00,76,00,\
      62,00,73,00,20,00,2d,00,6c,00,6f,00,63,00,6b,00,20,00,2d,00,66,00,6f,00,72,\
      00,63,00,65,00,64,00,69,00,73,00,6d,00,6f,00,75,00,6e,00,74,00,20,00,25,00,\
      31,00,00,00
    حالا متن زیر را در یک فایل notepad کپی کنید و با پسوند vbs ذخیره کنید و بعد فایل را در مسیر c:\windows\system32 کپی کنید(لازم به توضیح نیست که اگه ویندوزتون تو یه درایو دیگه مثلا d نصب شده باید تو درایو d کپی کنید...)

    کد:
     
    Set oWSH = CreateObject("Wscript.Shell")
    Args = ""
    Last = Wscript.Arguments.Count - 1
    For i = 0 To Last
     Args = Args & " " & Wscript.Arguments.Item(i)
    Next
    Args = Replace(Args,"\","")
    RetVal = oWSH.Run("manage-bde.exe" & Args,0,True)
    Wscript.Quit RetVal
    حالا روی درایوی که unlock شده کلیک راست کنید و lock رو بزنید...
    100% تست شده و جواب داده

    منبع هم فروم مایکروسافت بود...


    SADEGH65، ehsan653، zoorba و 2 نفر دیگر سپاسگزاری کرده‌اند.

  4. #64
    نام حقيقي: محمد حکیمی

    Administrator شناسه تصویری Hakimi
    تاریخ عضویت
    Dec 2002
    محل سکونت
    تهران
    نوشته
    6,549
    سپاسگزاری شده
    6798
    سپاسگزاری کرده
    1035
    نوشته های وبلاگ
    4
    Script برای
    ایجاد کاربر (Local)
    حذف کاربر (Local)
    تغییر رمز عبور
    ایجاد رمز عبور تصادفی
    کنترل موجود بودن کاربر (Local)
    ایجاد گروه (Local)
    حذف گروه (Local)
    کنترل موجود بودن گروه (Local)
    افزودن کاربر (Local) به یک گروه (Local)
    حذف کاربر (Local) از یک گروه (Local)


    کد:
     ' You can roll these constants into the functions if you want to pack everything
    ' into one function or set of functions. Or you can delete the constant statements
    ' and simply pass the values instead.
    
    CONST ADS_UF_SCRIPT = &H0001                   '  Logon script will be executed
    CONST ADS_UF_ACCOUNTDISABLE = &H0002           '  Account is disabled
    CONST ADS_UF_HOMEDIR_REQUIRED = &H0008         '  Account requires a home directory
    CONST ADS_UF_LOCKOUT = &H0010                  '  Account is locked out
    CONST ADS_UF_PASSWD_NOTREQD = &H0020           '  Account does not require a password
    CONST ADS_UF_PASSWD_CANT_CHANGE = &H0040       '  User cannot change password
    CONST ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = &H0080 '  Encrypted text password
                                                          ' allowed
    CONST ADS_UF_DONT_EXPIRE_PASSWD = &H10000      '  Account password never expires
    CONST ADS_UF_SMARTCARD_REQUIRED = &H40000      '  Smartcard required for logon
    CONST ADS_UF_PASSWORD_EXPIRED = &H800000       '  Password has expired
    
    
    Function CreateUser(sUserName, sPassword, sDescription)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      If UserExists(sUserName) Then
        CreateUser = False
        Exit Function
      End If
    
      On Error Resume Next
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      set oNewUser = oContainer.Create("user", sUserName)
      oNewUser.SetPassword(sPassword)
    
      ' Set additional flags.
      oNewUser.put "UserFlags", ADS_UF_DONT_EXPIRE_PASSWD OR ADS_UF_PASSWD_CANT_CHANGE
      oNewUser.Description = sDescription
    
      oNewUser.SetInfo
    
      If Err.Number = 0 then
        If UserExists(sUserName) Then
          CreateUser = True
        Else
          CreateUser = False
        End If
      Else
        CreateUser = False
      End If
    
      On Error Goto 0 
    
    End Function
    
    Function DeleteUser(sUserName)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      If Not UserExists(sUserName) Then
        DeleteUser = False
        Exit Function
      End If
    
      On Error Resume Next
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      oContainer.Delete "user", sUserName
    
      If Err.Number = 0 then
        If UserExists(sUserName) Then
          DeleteUser = False
        Else
          DeleteUser = True
        End IF
      Else
        DeleteUser = False
      End If
    
      On Error Goto 0
    
    End Function
    
    Function UserExists(sUserName)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      'Returns True or False based on if the local user
      'exists.
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      oContainer.Filter = Array("user")
    
      bUserExists = False
      For Each oUser in oContainer
        If lcase(trim(oUser.Name)) = lcase(trim(sUserName)) Then
          bUserExists = True
          Exit For
        End If
      Next
    
      UserExists = bUserExists
    End Function
    
    Function ChangePassword(sUserName, sPassword)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      If UserExists(sUserName) Then
        Set oNetwork = CreateObject("WScript.Network")
        sComputerName = oNetwork.Computername
        Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUserName & ", user")
       
        oUser.SetPassword sPassword
       
        On Error Resume Next
    
        oUser.SetInfo
    
        If Err.Number = 0 Then
          ChangePassword = True
        Else
          ChangePassword = False
        End If
    
        On Error Goto 0
      Else
        ChangePassword = False
      End If
    End Function
    
    Function CreateGroup(sGroupName, sDescription)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
      If GroupExists(sGroupName) Then
        CreateGroup = False
        Exit Function
      End If
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      Set oGroup = oContainer.Create("group", sGroupName)
    
      oGroup.SetInfo
    
      Set oGroup = Nothing
      Set oContainer = Nothing
    
      Set oGroup = GetObject("WinNT://" & sComputerName & "/" & sGroupName & ",group")
      oGroup.Description = sDescription
      oGroup.SetInfo
    
      Set oGroup = Nothing
      Set oNetwork = Nothing
    End Function
    
    Function DeleteGroup(sGroupName)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      If Not GroupExists(sGroupName) Then
        DeleteGroup = False
        Exit Function
      End If
    
      On Error Resume Next
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      oContainer.Delete "group", sGroupName
    
      If Err.Number = 0 then
        If UserExists(sGroupName) Then
          DeleteGroup = False
        Else
          DeleteGroup = True
        End IF
      Else
        DeleteGroup = False
      End If
    
      On Error Goto 0
    
    End Function
    
    Function GroupExists(sGroupName)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
    
      'Returns True or False based on if the local group
      'exists.
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oContainer = GetObject("WinNT://" & sComputerName)
      oContainer.Filter = Array("group")
    
      bGroupExists = False
      For Each oGroup in oContainer
        If lcase(trim(oGroup.Name)) = lcase(trim(sGroupName)) Then
          bGroupExists = True
          Exit For
        End If
      Next
    
      GroupExists = bGroupExists
    End Function
    
    Function AddUserToGroup(sUserName, sGroup)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
      On Error Resume Next
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      
      Set oGroup = GetObject("WinNT://" & sComputerName & "/" & sGroup & ",group")
      Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUserName & ",user")
    
      If Not oGroup.IsMember(oUser.AdsPath) Then
        oGroup.Add(oUser.AdsPath)
      End If
    
      If Err.Number = 0 Then
        AddUserToGroup = True
      Else
        AddUserToGroup = False
      End If
     
      Set oNetwork = Nothing
      Set oGroup = Nothing
      Set oUser = Nothing
    
      On Error Goto 0
    End Function
    
    Function RemoveUserFromGroup(sUserName, sGroup)
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
      On Error Resume Next
    
      Set oNetwork = CreateObject("WScript.Network")
      sComputerName = oNetwork.Computername
      Set oGroup = GetObject("WinNT://" & sComputerName & "/" & sGroup & ",group")
      Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUserName & ",user")
    
      If oGroup.IsMember(oUser.AdsPath) Then
        oGroup.Remove(oUser.AdsPath)
      End If
     
      If Err.Number = 0 Then
        RemoveUserFromGroup = True
      Else
        RemoveUserFromGroup = False
      End If
     
      Set oNetwork = Nothing
      Set oGroup = Nothing
      Set oUser = Nothing
     
      On Error Goto 0
    End Function
    
    Function RndPassword(vLength)
      'This function will generate a random strong password of variable
      'length.
      'This script is provided under the Creative Commons license located
      'at Creative Commons — Attribution-Noncommercial 2.5 Generic . It may not
      'be used for commercial purposes with out the expressed written consent
      'of NateRice.com
     
      For x=1 To vLength
        Randomize
        vChar = Int(89*Rnd) + 33
        If vChar = 34 Then 'this is quote character, replace it with a single quote
          vChar = 39
        End if
    
        RndPassword = RndPassword & Chr(vChar)
      Next
    
    End Function



    SADEGH65، scope، mgholami و 6 نفر دیگر سپاسگزاری کرده‌اند.
    محمد حکیمی
    hakimi [a t] gmail.com

  5. #65
    نام حقيقي: Mohammad

    عضو ویژه شناسه تصویری th95
    تاریخ عضویت
    Sep 2008
    نوشته
    4,263
    سپاسگزاری شده
    5765
    سپاسگزاری کرده
    2674
    نوشته های وبلاگ
    20
    Create User Accounts from Information in an Excel Spreadsheet

    کد:
    http://msdn.microsoft.com/en-us/library/ms974568.aspx



    Create User Accounts from Information in an Excel Spreadsheet
    Greg Stemp
    Microsoft Corporation
    April 14, 2004
    Summary: Demonstrates how script writers can retrieve information stored in a Microsoft Excel spreadsheet and use that information to create new user accounts in Microsoft Active Directory. (13 printed pages)

    System administrators, or so we are often told, are the last of the rugged individualists. System administrators don't use mice and dropdown lists; they type their commands at the command line. System administrators don't bother with graphical user interfaces; they like their data displayed in the command window. System administrators don't pull up to the drive-through window at a fast-food restaurant, they actually get out of the car and... well, okay, even rugged individualists have to draw the line somewhere. The point is, you can run a script by starting it from the command prompt and passing it a bunch of command-line arguments; in addition, you can output data to the command window or to a text file. What more could you possibly need?
    The truth is, there are lots of times you don't need anything else. On the other hand, sometimes—just sometimes, mind you—system administrators look at applications like Microsoft® Excel and think about how nice it would be to harness some of the capabilities Excel for their own use. Consider, for example, the need to create a bunch of new user accounts in Microsoft® Active Directory®. Could you do that by passing command-line parameters to a script? Sure, if you don't mind typing in command strings similar to this:
    cscript new_user.vbs /cn="Myer Ken" /sAMAccountName="kenmyer" /givenName="Ken" /SN="Myer"
    Okay, maybe that's not such a good idea. But couldn't you read in all the information from a text file? You bet you could. Of course, the text file would have to look something like this:
    "CN","sAMAccountName","givenName","SN"
    "Myer Ken","kenmyer","Ken","Myer"
    "Jones TiAnna","TiAnnajones","TiAnna","Jones"
    "Smith Ben","Bensmith","Ben","Smith"
    That works, too, but good luck getting your HR department to supply you with a text file that looks like that. Can you use these techniques? If you want to. But think about how easy it would be for your HR department (or whoever) to type all this information in Excel; in fact, there's a good chance that's what they already do. Yes, Excel is a graphical utility, and, yes, you're a rugged individualist, but just this once, wouldn't it be nice to be able to take an Excel spreadsheet, run a script against it, and then use the information gleaned from the spreadsheet to create a whole bunch of user accounts, all in one fell swoop?
    Okay, sure, not for you. But maybe you have a friend who isn't as rugged an individualist as you are. If so, tell your friend that he or she is in luck. This month we're going to tell you—um, we're going to tell them how to use a script to read data directly from an Excel spreadsheet, and then use that data to create a bunch of new user accounts in Active Directory. And then next month we'll show them how to go the opposite route: How to grab data out of Active Directory (or some other location) and display it in a nicely-formatted spreadsheet. And listen: If you decide to try these scripts, we promise not to tell your fellow system administrators. Promise.
    Creating and Terminating an Instance of Microsoft Excel

    Let's start with the simplest possible script, one that creates an instance of Microsoft Excel and then adds a new workbook to that instance:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add





    That was easy enough, wasn't it? Save your new script as a .vbs file and run it; when you do, your desktop should look something like this (depending, of course, on the wallpaper you're using):

    Figure 1. Creating an invisible instance of Excel
    Just think, you've only been at this for a few minutes, and you've already written a script that does absolutely nothing. You're now qualified to be a Microsoft Scripting Guy!
    But wait, don't go; it turns out that when you are scripting Microsoft® Office applications, what you see (or don't see) isn't necessarily what you get. The preceding script actually worked, and you really did create a brand-new instance of Microsoft Excel. (Don't believe me? Then press CTRL-ALT-DEL and take a look at the Processes tab in the Microsoft® Windows® Task Manager. You should see an instance of Excel.exe.) In other words, here is your first official Microsoft Office scripting lesson: By default, any time you use a script to create an instance of a Microsoft Office application, that application runs in a window that is not visible on screen. Excel is there; you just can't see it. (Sort of like the last raise they said you got.)
    Now, believe it or not, this is actually a good thing. This is a real, live instance of Microsoft Excel. As you'll soon see, you can programmatically read data from it or, for that matter, do pretty much anything else you can do with Excel. The only functionality you lose when Excel runs in an invisible window is the ability to type something on the keyboard and have the application react to those keystrokes. And that's what makes the default behavior useful. Suppose you were running a script that created a report using Excel, and suppose Excel was visible the whole time the script was running. A user (even yourself) could accidentally hit a key on the keyboard and ruin the entire report. A user (even yourself) could simply close Excel, ruining not only the report, but also causing your script to blow up. (After all, the script will be trying to send commands to an instance of Excel that no longer exists.) By running Excel invisibly, you can sidestep problems like that. The truth is, scripting Microsoft Excel is no different than being a parent: sometimes it's better thatyou don't see what's going on.
    Tip Okay, so what if you would like Excel to be visible on screen? No problem, just set the Visible property to True. This little script will create an instance of Microsoft Excel and—just like magic—make that instance appear on your screen:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    objExcel.Visible = True





    As an introduction to Microsoft Office scripting lesson number 2, let's modify this script so it creates an instance of Excel, displays it on screen, pauses for 10 seconds, and then quits. (Something remarkably similar to my typical workday.) Here's our modified script:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    objExcel.Visible = True
    Wscript.Sleep 10000
    Wscript.Echo "The script is now complete."





    What happens when you run this script? Well, an instance of Excel will be created, and it will appear on your screen. There will be a 10-second pause, and then a message will appear telling you that the script is now complete. When you click OK, the script will immediately terminate (as soon as Microsoft® VBScript reaches the end of a script, the script process terminates).
    And here's what your screen will look like:

    Figure 2. Excel running after a script terminates
    As you can probably tell, even though the script is finished, Microsoft Excel is still running; it didn't terminate when the script terminated. Thus your second official Microsoft Office scripting lesson: Microsoft Office applications run "out-of-process." What does that mean? Well, some COM objects (such as the FileSystemObject) run in the same process as your script. That means that when the process in which the script is running is terminated, then the process in which the COM object is running is terminated too (seeing as how they're the same process). When the script process terminates, the FileSystemObject terminates as well.
    Not willing to take my word for this? Then I'll prove it. Write a script that creates an instance of the FileSystemObject, open up Task Manager, and then run the script. When the script runs, you'll notice that only one new process is created (either Cscript.exe or Wscript.exe, depending on which script host you are using). That's because both the script and the FileSystemObject share that process.
    Okay, stop fretting; we'll write a FileSystemObject script for you:
    Copy

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder("C:\")
    Wscript.Sleep 10000
    Wscript.Echo "The script is now complete."





    Now, write a script that creates an instance of Microsoft Excel, open up Task Manager, and then run that script. You should see two new processes: Wscript.exe (or Cscript.exe) and Excel.exe. That's because Excel runs in its own process. When your script finishes; the script process (Wscript.exe or CScript.exe) will disappear, but the Microsoft Excel process (Excel.exe) will continue chugging along.
    This is, by the way, is very important: Unless you specifically quit Excel, Excel.exe will continue to run (and continue to use up memory). What if you run 5 scripts that each create an instance of Excel? In that case, your Task Manager is going to look something like this:

    Figure 3. Multiple instances of Excel in Task Manager
    Not a pretty sight, and a good way to quickly exhaust all the available resources on a computer. Remember: terminating a script will not automatically terminate a Microsoft Office application.
    Sounds a little hopeless, doesn't it? But don't despair. Do you need to terminate an instance of Excel? Then just make sure that somewhere in your script you use the Quit command to terminate that instance. For example, here's a script that creates an instance of Excel, pauses for 10 seconds, uses the Quit command to close Excel, pauses for 10 more seconds, and then automatically terminates. If you run this script while Task Manager is up, you'll see two new processes get created—Wscript.exe (or Cscript.exe) and Excel.exe—and then, after a brief pause, you'll see first Excel.exe and then the script host process disappear.
    Copy

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    objExcel.Visible = True
    Wscript.Sleep 10000
    objExcel.Quit
    Wscript.Sleep 10000





    Tip You'll sometimes see script writers set their object reference to Nothing, something like this:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    objExcel.Visible = True
    Wscript.Sleep 10000
    Set objExcel = Nothing





    This releases the object reference (that is, objExcel will no longer refer to an instance of Microsoft Excel), but it doesn't terminate Excel; in fact, Excel.exe continues to run as though nothing happened, simply because nothing did happen. If you want to get rid of Microsoft Excel (um, in a scripting sense, that is), you have to use the Quit command.
    Opening an Excel Spreadsheet

    So far we've managed to create an instance of Microsoft Excel and then immediately terminate that instance. For some of you, that might be good enough. If so, feel free to grab your coat and head for home. Thanks for sticking with us this far. Others, however, might want to do something a bit more exotic, something like, say, actually reading data from a spreadsheet.
    To do that, we need to do three things:

    1. Create an instance of Microsoft Excel. We've already mastered this part of the process.
    2. Open the desired spreadsheet.
    3. Read in the data.

    Let's jump to step 2 and see if we can open the spreadsheet. In the Excel object model (for details, see the Excel Object Model Overview on MSDN), spreadsheets are contained within the Workbooks object. Believe it or not, you already knew that; in the first script we showed you. You used this line of code to add a new workbook to the collection:
    Copy

    objExcel.Workbooks.Add





    To open a spreadsheet, we need to create an instance of the Workbooks collection, and then use the Open method to open the spreadsheet. That sounds complicated, but counting the CreateObject call that creates an instance of Excel, it takes just two lines of code:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open("C:\Scripts\New_users.xls" )





    That's it: We create an instance of Excel, and then the line in boldface opens the file C:\Scripts\New_users.xls. Want to open a different .xls file? No problem. Just replace C:\Scripts\New_users.xls with the appropriate file path. Of course, needless to say, the script won't work unless you actually have a file named New_users.xls in the C:\Scripts folder. And it won't work, either, unless you have Excel installed on your computer. (If you thought you could avoid buying Microsoft Office simply by running this script, well, sorry to disappoint you.)
    Note Are there other ways to open a spreadsheet programmatically? Yes. In fact, there are other ways to do many of the tasks we'll accomplish in this column. In the interests of time and space, however, we'll use methods that are easiest for newcomers to Excel scripting. If you're interested in learning about others ways to carry out these same tasks, check out the Excel object model documentation.
    Reading an Excel Spreadsheet

    Now that we know how to open a spreadsheet, let's talk about what that spreadsheet should look like before we try retrieving data from it. You can do some pretty fancy programming with Excel. For example, you could take a spreadsheet that you knew absolutely nothing about and meticulously work your way around it, figuring out everything on the fly. That's fine, but it also requires a lot of additional code. Therefore, we're going to cheat a little when we create our spreadsheet, and I'm going to recommend that you cheat the same way when setting up your new user spreadsheet:

    • We're going to assume that column headings for the various user attributes are in row 1.
    • We're going to assume that data for the individual users begins in row 2.
    • We're going to assume that there are no blank rows anywhere in the data. In other words, if we have data for User A in row 2, we won't leave row 3 blank and then put the data for User B in row 4. Instead, the data for User B will appear in Row 3.
    • We'll make sure that a mandatory attribute appears in column 1. A mandatory attribute is an attribute that every new object must have; in the case of user account objects, that means a CN and a sAMAccountName. If we make, say, CN the first column, then every user must have an entry in that column; if there's no entry in row 13, column 1, we can assume we've reached the end of the data. (Or that we made a mistake when entering the data. But what are the odds of something like that happening?) By contrast, if we put an optional attribute (such as telephoneNumber) in column 1, then finding out that row 13, column 1 is empty wouldn't tell us much: it could mean that we've reached the end of the data, but it could also mean that this particular user simply doesn't have a phone number.

    Here's what an abbreviated spreadsheet for creating user accounts might look like:

    Figure 4. A sample spreadsheet for creating user accounts
    If you take a close look at our sample spreadsheet, you'll see that we have four columns and four rows. You'll also see that the CN for our new user is stored in column 1, the SAM Account name in column 2, the first name in column 3, and the last name in Column 4.
    Note Like the preceding example, your spreadsheet probably lists columns as A, B, C, and D instead of 1, 2, 3, and 4. That won't make any difference; the script will work just fine regardless. However, if it would be easier for you to view column headings as numbers, do this: In Excel, click on Tools, then click Options. In the Options dialog box, on the General tab, select R1C1 reference style and then click OK. Voila! Column headings are now number rather than names. Or at least that's how you do this in Office 2003 and Office XP. If you have a previous version of Office, the steps might vary slightly.
    So where is the data for our first user? Using the RF1C1 notation, it's right here:
    CNSAM Account NameFirst NameLast NameR2C1R2C2R2C3R2C4
    Notice the pattern? The row number remains the same, but the column number changes each time. What about the first two users in the spreadsheet?
    CNSAM Account NameFirst NameLast NameR2C1R2C2R2C3R2C4R3C1R3C2R3C3R3C4
    The only difference is that the data for User 1 is found in row 2, while the data for User 2 is found in the next row. That suggests that we could read the data in cells R2C1 through R2C4 and get all the available information for User 1. And what if we wanted the information for the next user? All we'd have to do is drop down a row and read the data found in columns 1–4. And to get the information for the next user, we'd just have to drop down another row. Elementary, my dear Watson.
    In fact, we now know how to get all the data out of the spreadsheet, in part because we have some inside information. We don't know how many rows there are in the spreadsheet, but we do know that:

    • The first row containing data is row 2. (Row 1 is just a header row.)
    • The data is only found in columns 1–4. (And we even know which data is found in each column.)
    • If we encounter an empty cell in column 1, then we must be at the end of the data.

    Without writing a single line of code, how would we go about grabbing data out of the spreadsheet? Well:
    We'd start in row 2, column 1 and get the CN for the user. We'd then grab the data in row 2, column 2 (SAM Account Name); row 2, column 3 (first name); and row 2, column 4 (last name).
    We'd then drop down to row 3, column 1 and get the CN for the next user. What if there wasn't a CN for the next user (that is, what if the cell is empty)? In that case, we're done; we've got all the data, and it's time to go do something else. If there is a value, we grab it, then retrieve the data from columns 2, 3, and 4. We then drop down to row 4, and start the process all over again.
    Sounds pretty easy, doesn't it? Surprisingly enough, the actual code is just as easy. Here's a script that reads through an Excel spreadsheet, and echoes the values found in each cell. Let's take a look at the code, and then talk about what it does:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open _
    ("C:\Scripts\New_users.xls")
    intRow = 2
    Do Until objExcel.Cells(intRow,1).Value = ""
    Wscript.Echo "CN: " & objExcel.Cells(intRow, 1).Value
    Wscript.Echo "sAMAccountName: " & objExcel.Cells(intRow, 2).Value
    Wscript.Echo "GivenName: " & objExcel.Cells(intRow, 3).Value
    Wscript.Echo "LastName: " & objExcel.Cells(intRow, 4).Value
    intRow = intRow + 1
    Loop
    objExcel.Quit





    We've already discussed the first couple lines of code, so let's skip to this one: intRow = 2. As you might expect, intRow is a variable that represents the current row in the spreadsheet. Why did we set intRow to 2 rather than to 1? That's easy: row 1 contains our column headings. The actual data doesn't start until row 2.
    Next we create a Do Loop that runs until the value in cell (intRow, 1) is equal to nothing. What does that mean? Well, when we start the script, intRow is equal to 2; what we do right off the bat is check to see what the value of row 2, column 1. If it's nothing, that is, if no CN has been entered, we exit the loop. We're assuming we've reached the end of the data. But what if there is data in row 2, column 1? No problem. We enter the loop and run the rest of the code.
    Incidentally, in this sample script all we do is echo the values found in columns 1, 2, 3, and 4. In a minute we'll show you how to do something a bit more interesting, but for our first crack at Excel scripting we'll keep it simple.
    And sowhat happens next? (I know, the suspense is killing you, isn't it?) Well, first we increment intRow by 1. Why? Remember, when we first entered the loop, intRow was set to 2 to ensure that we grabbed all the data from row 2. Having done that, we now want to grab all the data from row 3. If we increment intRow by 1, it will magically transform from a 2 to a 3, and we'll be ready to read data from row 3. After we do that, the intRow = intRow + 1 statement will change intRow to 4, and we'll be ready to loop around and read data from row 4. Make sense?
    We then loop back to the Do Until statement to see if (intRow, 1)—which now means row 3, column 1—is empty. If it's not, we enter the loop and read the data from row 3. If it is empty, we exit the loop and go to the last line of code, which simply terminates Excel.
    If you run the script against the sample spreadsheet we looked at earlier, you should get output similar to this:
    Copy

    CN: Myer Ken
    sAMAccountName: KenMyer
    GivenName: Ken
    LastName: Myer
    CN: Jones TiAnna
    sAMAccountName: TiAnnaJones
    GivenName: TiAnna
    LastName: Jones
    CN: Smith Ben
    sAMAccountName: BenSmith
    GivenName: Ben
    LastName: Smith





    Could there be anything more exciting?
    Okay, now that you mention it, I suppose using this data to create some user accounts would be a bit more exciting, wouldn't it? Fine. Let's grab some data from the spreadsheet, then use that data to create some new user accounts. That might sound a bit daunting, but believe it or not, we've already taken care of the hard part. Now we just need to add in a little ADSI code to create the accounts.
    Creating a User Account

    I'm not going to talk about ADSI in this column. For more information on ADSI, see either the ADSI SDK or the Windows 2000 Scripting Guide. For now, just take my word for it that this code will create a user account in the Finance OU in fabrikam.com:
    Copy

    Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
    Set objUser = objOU.Create("User", "cn=Myer Ken")
    objUser.sAMAccountName = "myerken"
    objUser.GivenName = "Ken"
    objUser.SN = "Myer"
    objUser.AccountDisabled = FALSE
    objUser.SetInfo





    What we're going to do next is take this code and merge it with our read-from-Excel script. How do we do that? Well, for starters, we simply replace hard-coded values in the ADSI portion of the script with the appropriate value from our spreadsheet. For example, take this line of ADSI code:
    Copy

    objUser.GivenName = "Ken"





    We know that the user's first name (the GivenName attribute) can be found in column 3 of whatever row we're looking at. All we have to do, then, is toss out the hard-coded value "Ken" and replace it with the appropriate location on the spreadsheet:
    Copy

    objUser.GivenName = objExcel.Cells(intRow, 3).Value





    After that, we just take our original script and throw out all the lines that echo things to the screen, replacing those lines with these new ones that set the value of user account attributes. Let's combine our Excel script with our ADSI script and see what we end up with:
    Copy

    Set objExcel = CreateObject("Excel.Application")
    Set objWorkbook = objExcel.Workbooks.Open _
    ("C:\Scripts\New_users.xls")
    intRow = 2
    Do Until objExcel.Cells(intRow,1).Value = ""
    Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
    Set objUser = objOU.Create _
    ("User", "cn=" & objExcel.Cells(intRow, 1).Value)
    objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
    objUser.GivenName = objExcel.Cells(intRow, 3).Value
    objUser.SN = objExcel.Cells(intRow, 4).Value
    objUser.AccountDisabled = FALSE
    objUser.SetInfo
    intRow = intRow + 1
    Loop
    objExcel.Quit





    This is way too easy. Previously our Excel script echoed values to the screen:
    Copy

    Wscript.Echo "LastName: " & objExcel.Cells(intRow, 4).Value





    Now, about all we've done is replace Wscript.Echo with the appropriate ADSI command:
    Copy

    objUser.SN = objExcel.Cells(intRow, 4).Value





    That's all there is to it.
    Where Do We Go From Here?

    Admittedly, this was a pretty simple example: only four attributes, and all the users were being created in the same OU. But if you want to include additional attributes (department, telephoneNumber, homeDirectory, whatever), then just create additional columns in your spreadsheet and add the appropriate lines of code. For example, if you put the user's phone number on column 5, then add this line of code to your script:
    Copy

    objUser.telephoneNumber = objExcel.Cells(intRow, 5).Value





    And what if you want to create users somewhere other than the Finance OU? Again, no problem. Put the OU name in a column (let's say column 6), and then adjust the line of code that connects to the desired OU:
    Copy

    Set objOU = GetObject _
    ("ou=" & objExcel.Cells(intRow, 6).Value & _
    ", dc=fabrikam, dc=com")





    Is that cool or what?
    Will things always work this smooth? In general, yes, but not always. After all, ADSI does have a few eccentricities (things like multi-attribute values and bitmask values). If you need to set multi-value or bitmask attributes, those particular lines of code aren't as straightforward as doing this:
    Copy

    objUser.otherTelephone = objExcel.Cells(intRow, 10).Value





    Instead, you'll have to do something along the lines of this:
    Copy

    objUser.PutEx ADS_PROPERTY_UPDATE, "otherTelephone",
    Array(objExcel.Cells(intRow, 10).Value)





    But you'll figure it out without too much trouble. Just check the ADSI SDK and the Windows 2000 Scripting Guide for details.
    Next month we'll show you how to put data into an Excel spreadsheet. In the meantime, write to us at scripter@microsoft.com if you have any questions or comments about this. And don't worry: Just because you're using Excel in your scripts doesn't mean you have to start drinking Chai tea or using lace doilies; you're still as rugged an individualist as ever. Although a Chai tea would taste good right about now ...




    Hakimi، SADEGH65 و ehsan653 سپاسگزاری کرده‌اند.

  6. #66
    نام حقيقي: Mohammad

    عضو ویژه شناسه تصویری th95
    تاریخ عضویت
    Sep 2008
    نوشته
    4,263
    سپاسگزاری شده
    5765
    سپاسگزاری کرده
    2674
    نوشته های وبلاگ
    20
    Export All User's Properties to Excel Spreadsheet


    SET objRootDSE = GETOBJECT("LDAP://RootDSE")
    strExportFile = "C:\temp\MyExport.xls"

    strRoot = objRootDSE.GET("DefaultNamingContext")
    strfilter = "(&(objectCategory=Person)(objectClass=User))"
    strAttributes = "sAMAccountName,userPrincipalName,givenName,sn ," & _
    "initials,displayName,physicalDeliveryOfficeNa me," & _
    "telephoneNumber,mail,wWWHomePage,profilePath, " & _
    "scriptPath,homeDirectory,homeDrive,title,departme nt," & _
    "company,manager,homePhone,pager,mobile," & _
    "facsimileTelephoneNumber,ipphone,info," & _
    "streetAddress,postOfficeBox,l,st,postalCode,c "
    strScope = "subtree"
    SET cn = CREATEOBJECT("ADODB.Connection")
    SET cmd = CREATEOBJECT("ADODB.Command")
    cn.Provider = "ADsDSOObject"
    cn.Open "Active Directory Provider"
    cmd.ActiveConnection = cn

    cmd.Properties("Page Size") = 1000

    cmd.commandtext = "<LDAP://" & strRoot & ">;" & strFilter & ";" & _
    strAttributes & ";" & strScope

    SET rs = cmd.EXECUTE

    SET objExcel = CREATEOBJECT("Excel.Application")
    SET objWB = objExcel.Workbooks.Add
    SET objSheet = objWB.Worksheets(1)

    FOR i = 0 To rs.Fields.Count - 1
    objSheet.Cells(1, i + 1).Value = rs.Fields(i).Name
    objSheet.Cells(1, i + 1).Font.Bold = TRUE
    NEXT

    objSheet.Range("A2").CopyFromRecordset(rs)
    objWB.SaveAs(strExportFile)


    rs.close
    cn.close
    SET objSheet = NOTHING
    SET objWB = NOTHING
    objExcel.Quit()
    SET objExcel = NOTHING

    Wscript.echo "Script Finished..Please See " & strExportFile




  7. #67
    نام حقيقي: Mohammad

    عضو ویژه شناسه تصویری th95
    تاریخ عضویت
    Sep 2008
    نوشته
    4,263
    سپاسگزاری شده
    5765
    سپاسگزاری کرده
    2674
    نوشته های وبلاگ
    20
    Script to add Users to Local Administrators Group on their Computers

    This script can be used to add individual users to local administrators group on their own computers in a Domain.
    The script is run from a GPO linked to a Domain or OU. Since the script checks for computer name first, and if the name matches to the one in the Select Cases, then the user specified is added to the local administrators group on that computer.
    The script should be put in a GPO under Computer Configuration\Policies\Windows Settings\Scripts\Startup. Simply add more Case(s) for more computer names etc.


    on error resume next

    Dim DomainName

    Set net = WScript.CreateObject("WScript.Network")

    ComputerName= net.ComputerName
    DomainName = "CONTOSO"


    set objGroup = GetObject("WinNT://"& ComputerName &"/Administrators")

    SELECT Case ComputerName

    Case "WINXP01"
    objGroup.Add "WinNT://"& DomainName &"/User1" &""

    Case "WINXP02"
    objGroup.Add "WinNT://"& DomainName &"/User2" &""

    Case "WINXP03"
    objGroup.Add "WinNT://"& DomainName &"/User3" &""

    End Select





  8. #68
    نام حقيقي: Mohammad

    عضو ویژه شناسه تصویری th95
    تاریخ عضویت
    Sep 2008
    نوشته
    4,263
    سپاسگزاری شده
    5765
    سپاسگزاری کرده
    2674
    نوشته های وبلاگ
    20
    Add User Accounts Based on Information in a Text File


    ' Open up the text file
    Dim oFSO, oTS, sOU, sGrp
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oTS = oFSO.OpenTextFile("c:\users.csv")

    Const ADS_PROPERTY_APPEND = 3

    ' Get a reference to the AD domain using ADSI
    Set objOU = GetObject("LDAP://OU=Students,OU=Users,OU=Enterprise,DC=homelab,DC=p rv")
    sOU = ",OU=Students,OU=Users,OU=Enterprise,DC=homelab,DC =prv"
    sGrp = "CN=Scripting Students,OU=Security Groups,OU=Enterprise,DC=homelab,DC=prv"
    Set objGroup = GetObject("LDAP://" & sGrp)

    ' create the necessary variables
    Dim sUserID, sGivenName, sDisplayname, sSurname, sDescription, sPassword

    'skip the first line of the file
    Dim sLine, sData
    sLine = oTS.ReadLine

    ' now go through the file one line at a Time
    Do Until oTS.AtEndOfStream

    On Error Resume Next

    'read the line and split it on the commas
    sLine = oTS.ReadLine
    sData = Split(sLine,",")

    ' get the user information from this row
    'sPassword = sData(0)
    sGivenName = sData(0)
    sSurname = sData(1)
    sDisplayname = sData(2)
    sUserID = sData(3)


    ' create the user account
    Set objUser = objOU.Create("User", "cn=" & sDisplayname)

    ' Set account properties
    objUser.Put "sAMAccountName", sUserID
    objUser.Put "userPrincipalName", sUserID & "@homelab.prv"
    objUser.Put "givenName", sGivenName
    objUser.Put "sn", sSurname
    objUser.Put "displayName", sDisplayname
    objUser.Put "description", "Scripting Student"
    objUser.Put "telephoneNumber", "555.1212"
    objUser.Put "company", "Scripting School"
    objUser.Put "homeDirectory", "\\dc\users$\" & sUserID
    objUser.TerminalServicesProfilePath = "\\dc\tsprofiles$\" & sUserID
    objUser.Put "scriptPath", "studentlogon.bat"
    objUser.Put "street", "1234 Some Street"
    objUser.Put "l", "Some Town"
    objUser.Put "postalCode", "27410"
    objUser.Put "co", "United States"

    ' save the account
    objUser.SetInfo

    ' enable the account
    objUser.Put "userAccountControl", "512"


    ' Add user to a group
    objGroup.PutEx ADS_PROPERTY_APPEND,"member", Array("cn=" & sDisplayname & sOU)
    objGroup.SetInfo

    ' set the password and save the password
    objUser.SetPassword "P@$$w0rd"
    objUser.SetInfo

    ' force the user to change their password at first logon
    objUser.Put "pwdLastSet", 0
    objUser.SetInfo


    Loop

    ' Final clean up, close down
    oRS.Close
    oTS.Close
    WScript.Echo "The Users have been created!!!."


    ehsan653 سپاسگزاری کرده است.

  9. #69
    نام حقيقي: +++AnathemA+++

    عضو ویژه شناسه تصویری mahyar49
    تاریخ عضویت
    May 2009
    محل سکونت
    021
    نوشته
    913
    سپاسگزاری شده
    879
    سپاسگزاری کرده
    673
    سلام
    چند وقت پیش با آقای نجاتی زاده در مورد ادمین لوکال بودن کاربرها صحبت می کردیم
    من گفتم اگه یه کاربر ادمین لوکال باشه و بخواد اذیت کنه میاد گروه Domain Admins رو از گروه Administrators خارج می کنه و باعث زحمت ادمین شبکه میشه!
    آقای نجاتی زاده گفت برای اینکار من اسکریپتی ساختم که هربار کاربر log off می کنه دوباره گروه Domain Admins به گروه Administrators اضافه میشه...
    برام جالب بود دیدم که با اینکار خیالمون خیلی راحت تر هستش!

    اسکریپتش رو آماده کردم و گذاشتم اینجا که هر کسی خواست استفاده کنه

    ----------------
    این اسکریپت گروه Domain Admins را به گروه local Administrators اضافه می کنه

    کد:
     
    Dim WSHShell, WshSysEnv
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Set WshSysEnv = WshShell.Environment("PROCESS")
    On Error Resume Next
    UserString = WshSysEnv("COMPUTERNAME")
    GroupString = "Administrators"
    Set GroupObj = GetObject("WinNT://" & UserString & "/" & GroupString)
    GroupObj.Add ("WinNT://persiannetworks.com/Domain Admins")
    Set GroupObj = Nothing
    Set WshShell = Nothing
    Set WshSysEnv = Nothing
    Wscript.Quit
    به جای persiannetworks.com نام دامین شبکه تون رو بنویسید


    SADEGH65، zzzzesht، aliafzalan و 2 نفر دیگر سپاسگزاری کرده‌اند.

  10. #70
    نام حقيقي: Mohammad

    عضو ویژه شناسه تصویری th95
    تاریخ عضویت
    Sep 2008
    نوشته
    4,263
    سپاسگزاری شده
    5765
    سپاسگزاری کرده
    2674
    نوشته های وبلاگ
    20
    این کار تا جایی که میدونم نیاز به اسکریپت نداره
    با خود GPO میشه درسته ؟



  11. #71
    نام حقيقي: حسین پالوایه

    عضو غیر فعال
    تاریخ عضویت
    Jul 2010
    محل سکونت
    تبریز
    نوشته
    1
    سپاسگزاری شده
    0
    سپاسگزاری کرده
    0
    سلام
    من اسکریپتی می خوام که وقتی کاربر به سیستم logon می کنه پیغامی برایش نمایش دهده شود اسکریپتش رو چطوری باید نوشت؟



  12. #72
    ARM
    ARM آنلاین نیست.
    نام حقيقي: علیرضا مشعلی

    مدیر بازنشسته شناسه تصویری ARM
    تاریخ عضویت
    May 2005
    محل سکونت
    اهواز
    نوشته
    1,898
    سپاسگزاری شده
    2497
    سپاسگزاری کرده
    1832
    نقل قول نوشته اصلی توسط palvayeh نمایش پست ها
    سلام
    من اسکریپتی می خوام که وقتی کاربر به سیستم logon می کنه پیغامی برایش نمایش دهده شود اسکریپتش رو چطوری باید نوشت؟
    حسین جان ،
    پست شماره 63 همین تاپیک را مطالعه فرمایید .


    esmail2009 سپاسگزاری کرده است.

  13. #73
    نام حقيقي: .

    عضو غیر فعال
    تاریخ عضویت
    Oct 2010
    محل سکونت
    .
    نوشته
    2
    سپاسگزاری شده
    0
    سپاسگزاری کرده
    2
    سلام
    من این چیزی که اینجا دیدم اسکریپت واسه Map Drive عمومی بود که همه Share رو ببینن
    اما من یه Map Drive میخوام که هر یوزر یه دونه واسه خودش داشته باشه و پشت هر سییتمی که میشینه وقتی لاگین میکنه درایوش رو ببینه و هیچ کس هم درایو شخص دیگه رو نتونه ببینه . این کار رو میتونم دستی انجام بدم اما اینکه مثلا 200 تا یوزر داشته باشی حتما باید BatchFile باشه والا پوست ادم کندست
    حالا کسی نظری داره ؟



  14. #74
    nkm
    nkm آنلاین نیست.
    نام حقيقي: Ali, Niknam

    مدیر بازنشسته شناسه تصویری nkm
    تاریخ عضویت
    Mar 2003
    محل سکونت
    Iran - Fars - Shiraz
    نوشته
    2,552
    سپاسگزاری شده
    519
    سپاسگزاری کرده
    197
    کافیه به جای نام کاربر از %username% استفاده کنی



  15. #75
    نام حقيقي: .

    عضو غیر فعال
    تاریخ عضویت
    Oct 2010
    محل سکونت
    .
    نوشته
    2
    سپاسگزاری شده
    0
    سپاسگزاری کرده
    2
    نقل قول نوشته اصلی توسط nkm نمایش پست ها
    کافیه به جای نام کاربر از %username% استفاده کنی

    میشه اون چیزی که توی نظرت هست رو بنویسی کامل
    چون من همین %username% رو داشتم اما کار نمیکرد
    بعد وقتی این رو اجرا کنم که جای دیگه نباید تنظیمات انحام داد ؟
    من که تا حالا هر چی زدم همش local بوده



صفحه 5 از 7 اولیناولین 1 2 3 4 5 6 7 آخرینآخرین

کلمات کلیدی در جستجوها:

پرشین نتورک

اسکریپت

نتورک ادمین

اسکریپت میکروتیک

اسکریپت ویندوز

http://forum.persiannetworks.com/f25/t31065.html

بانک اسکریپت

بانک

ادمین نتورک

اسکریپت در ویندوز

اسکریپت برای ویندوز

اسکریپت بانک

پرسین نتورکاضافه کردن پرینتر با اسکریپتconnection to dc scriptbatchفایلtelnet زدن در میکروتیکپ رسین نت ورکاسکریپت joinپرشن نتورکcloner.SendKeysبانك اسكريپاسكريپتterminalservicesprofilepath vbscriptبانک اسکرپیت

برچسب برای این موضوع

2003, 2008, 2008r2, 2911, 2960, 404, access, active, active directory, additional, admin, administrator, alias, application, archive, arp, backup, batch, bind, bios, bitlocker, browser, call, cdp, communication, computername, conference, configuration, control, crack, credentials, date, dcpromo, default gateway, delete, desktop, device, dhcp, disable, domain, domain controller, drive, email, enable, encrypt, error, failure, filter, finance, form, forum, gateway, google, gpo, group policy, gui, hardware, home page, host, html, http, img, install, ip address, ipconfig, ise, isolated, join, ldap, license, list, load, local, log off, log on to, login, loop, mac, map drive, memory, messaging, microsoft, microsoft office, monitoring, move, net stop, number, offline, page, password, personal, policy, pos, powershell, print server, problem, profile, queue, quota, ras, record, refresh, registerdns, remo, remote, remote desktop, replication, report, reset, resource kit, restart, restore, ris, role, route, run, s-1-5-21, sas, script, secure, send, serial, server, services, session, share, shared, sharepoint, shutdown, sms, smtp, smtp server, software, span, split, sql, start, startup, static, stop, support, switch, system center, target, telephone, telnet, test, ttl, update, user, username, فونت, فروش, لاگین, مایکروسافت, مدارک, نتورک, نصب شده, هستش, ویندوز, ویندوز 7, ورود, یوزر, کلاینتها, کمک, کانکشن, کار, کارها, کاربران, کردن, گوگل, گروپ پالیسی, پیشنهاد, پارتیشن, پرینتر, پرشین, پشتیبان گیری, vpn, wallpaper, wan, warning, web, web server, webpage, website, windows, windows server, windows server 2003, windows update, windows xp, word, wrt, wss, xml, آشنایی, اولین, اتوماتیک, اجرای, اسکریپت, اشتراک, اطلاعات, بک آپ, برنامه, تلنت, تنظیمات, تست, حداقل, حذف, خودکار, خودش, دومین, دانلود, درخواست, دستور, روی, روش, راهنمایی, رایگان, سوییچ, سیستم, سیستم سرور, سایت, شیر شده

نمایش برچسب ها

مجوز های ارسال و ویرایش

  • شما نمی توانید موضوع جدید ارسال کنید
  • شما نمی توانید به پست ها پاسخ دهید
  • شما نمی توانید فایل پیوست ضمیمه کنید
  • شما نمی توانید پست های خود را ویرایش کنید
  •