Announcement

Collapse
No announcement yet.

Yes I am a lazy scripter… but I need few things to be done so please help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Yes I am a lazy scripter… but I need few things to be done so please help

    So here is what I need:

    1. FTP transfer script
    Takes 2 parameters (location + name of the file, remote FTP destination)

    2. Account change script - add a user to group (using: net user /ADD /Domain etc… )
    Following parameters:
    User name
    Group name

    3. Change password to expire, causing the user to be required to change his password
    This one is a little tricky - can use PSEXEC
    Need a script with the user name as a parameter
    Using: DSQuery user -name UserX | DSGet user -DN -I can get the DN of a user
    Using: Dsmod user <UserDN> -pwd password -mustchpwd yes -to change

    4. Show members of a group
    Parameters are the user account, password and group name
    psexec \\domain_controller -u domain_slash_userid -p password net group "group name"

    5. Create account
    Parameter is the user name , group name
    Using the Net command


    Thanks in advance!

  • #2
    Re: Yes I am a lazy scripter… but I need few things to be done so please help

    I'm hopeful none of our scripting geniuses will bite on this request. You need to hire someone to do a bit of work for you. This is not a charity for lazy people.
    Cheers,

    Rick

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

    Comment


    • #3
      Re: Yes I am a lazy scripter… but I need few things to be done so please help

      rvalstar, if you search old posts you will notice that I do help people around here, but at least I'm not a schmuck, if you don't want to help don't but please don't tell others not to do the same!!!

      Comment


      • #4
        Re: Yes I am a lazy scripter… but I need few things to be done so please help

        2. Account change script - add a user to group (using: net user /ADD /Domain etc… )
        Following parameters:
        User name
        Group name
        Code:
         
        ' This VBScript code adds a member to a group.
        ' ---------------------------------------------------------------
        ' From the book "Active Directory Cookbook" by Robbie Allen
        ' ISBN: 0-596-00466-4
        ' ---------------------------------------------------------------
        ' ------ SCRIPT CONFIGURATION ------
        strGroupDN = "<GroupDN>" ' e.g. cn=SalesGroup,ou=Groups,dc=rallencorp,dc=com
        strMemberDN = "<MemberDN>" ' e.g. cn=jsmith,cn=users,dc=rallencorp,dc=com
        ' ------ END CONFIGURATION ---------
        set objGroup = GetObject("LDAP://" & strGroupDN)
        ' Add a member
        objGroup.Add("LDAP://" & strMemberDN)
        3. Change password to expire, causing the user to be required to change his password
        You can adapt this code to you needs:

        Code:
        ' This VBScript code sets the flag that requires a user to change their password
        
        ' ---------------------------------------------------------------
        ' From the book "Active Directory Cookbook" by Robbie Allen
        ' ISBN: 0-596-00466-4
        ' ---------------------------------------------------------------
        
        ' ------ SCRIPT CONFIGURATION ------
        strUserDN = "<UserDN>"  ' e.g. cn=rallen,ou=Sales,dc=rallencorp,dc=com
        ' ------ END CONFIGURATION ---------
        
        set objUser = GetObject("LDAP://" & strUserDN)
        objUser.Put "pwdLastSet", 0
        objUser.SetInfo
        WScript.Echo "User must change password at next logon: " & strUserDN
        Last edited by igor7; 24th November 2008, 16:39.

        Comment


        • #5
          Re: Yes I am a lazy scripter… but I need few things to be done so please help

          Originally posted by XtaZee View Post
          So here is what I need:

          1. FTP transfer script
          Takes 2 parameters (location + name of the file, remote FTP destination)
          You can use the -s:scriptFileName switch to script the FTP client (or ftp <scriptFileName). You could read the source and destination from the command line. Curl or some other command line tool might be better, but here is one take for plain Windows commands:

          Code:
          ::Batchup.cmd
          echo open %1 > script.tmp
          copy script.tmp+script.orig script.work
          del /q script.tmp
          echo put %2 >> script.work
          echo bye >> script.work
          
          ftp -s:script.work
          del /q script.work
          script.orig might be like this:

          Code:
          user
          joeuser
          joepassword
          bin
          and the batchup example.com foo.zip would generate commands like:
          Code:
          open example.com
          user
          joeuser
          joepassword
          bin
          put foo.zip
          bye
          -vP

          Comment


          • #6
            Re: Yes I am a lazy scripter… but I need few things to be done so please help

            Originally posted by XtaZee View Post
            rvalstar, if you search old posts you will notice that I do help people around here, but at least I'm not a schmuck, if you don't want to help don't but please don't tell others not to do the same!!!
            I take it by your reflexive phrase "I'm not a schmuck" that you're calling me one. Do look up the definition of the word. You can call me many things, a number of which will apply, but a schmuck is not one of them.

            I do want to "help". "Help" is fundamentally an act of assistance. This means the helper assists the helpee to accomplish a task the helpee is trying to action as best the helpee can. It is difficult to assist someone that is not willing to perform even the most rudimentary level of activity to reach his / her goal. What you've demonstrated in this thread is the need for someone to "take care of" you much in the way a parent takes care of a helpless newborn.

            That is the issue and that was the reason for my initial response. I should have been clear in that regard and I apologize for the ambiguity in my original statement.

            Not only have you thrown a laundry list of five distinct scripting requests into one, you have demonstrated (and proclaimed) to be lazy to the point where you have done absolutely no work to help yourself reach your goal. Had you come with the results of a Google exercise and a half-baked script that needed debugging, I wouldn't be railing you.
            Cheers,

            Rick

            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

            © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

            Comment


            • #7
              Re: Yes I am a lazy scripter… but I need few things to be done so please help

              Originally posted by XtaZee View Post
              rvalstar, if you search old posts you will notice that I do help people around here, but at least I'm not a schmuck, if you don't want to help don't but please don't tell others not to do the same!!!
              Not the greatest idea to be slating one of the site moderating team either.


              Tom
              For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

              Anything you say will be misquoted and used against you

              Comment


              • #8
                Re: Yes I am a lazy scripter… but I need few things to be done so please help

                Well, and from now on the thread will be monitored.
                Marcel
                Technical Consultant
                Netherlands
                http://www.phetios.com
                http://blog.nessus.nl

                MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
                "No matter how secure, there is always the human factor."

                "Enjoy life today, tomorrow may never come."
                "If you're going through hell, keep going. ~Winston Churchill"

                Comment


                • #9
                  Re: Yes I am a lazy scripter… but I need few things to be done so please help

                  Thanks for helping guys

                  here are some that I've written myself but unfortunately they are CMD and not VB Scripts but they work as well...

                  Code:
                  @ECHO OFF
                  Echo This will add a user to a given group in the domain 
                  
                  if "%~2" == "" goto :Usage
                  
                  SET groupname=%~1
                  SET username=%~2
                  
                  net group %groupname% %username% /add /domain 
                  
                  EXIT /b 0
                  
                  :Usage
                  
                  echo Use: from elevated prompt type adtogroup group_name user_name
                  Code:
                  @ECHO OFF
                  Echo This will add a user to the domain 
                  
                  if "%~2" == "" goto :Usage
                  
                  SET username=%~1
                  SET password=%~2
                  
                  net user %username% %password% /add /domain 
                  
                  EXIT /b 0
                  
                  :Usage
                  
                  echo Use: from elevated prompt type adduser user_name Password
                  Code:
                  @ECHO OFF
                  Echo This will show the users of a given group in the domain 
                  
                  if "%~1" == "" goto :Usage
                  
                  SET groupname=%~1
                  
                  net group %groupname% /domain
                  
                  EXIT /b 0
                  
                  :Usage
                  
                  echo Use: from elevated prompt type groupmembers groupname
                  Code:
                  @ECHO OFF
                  Echo This will show the users of a given local group 
                  
                  if "%~1" == "" goto :Usage
                  
                  SET groupname=%~1
                  
                  NET LOCALGROUP %groupname% 
                  
                  EXIT /b 0
                  
                  :Usage
                  
                  echo Use: from elevated prompt type localgroupmembers groupname

                  Comment


                  • #10
                    Re: Yes I am a lazy scripter… but I need few things to be done so please help

                    And you are unhappy with your CMD files in what way(s)? The results they produce or that they're CMD files or ??? Reason I ask is so we can understand the gaps and help suggest ways to fill them.
                    Cheers,

                    Rick

                    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

                    © 2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

                    Comment


                    • #11
                      Re: Yes I am a lazy scripter… but I need few things to be done so please help

                      OK, so I wasn't very lazy this past week and I've got me a nice UI for the CMD scripts
                      it uses a simple XML file for configuring just about ... everything

                      I am trying now to write a VBscript that will do port scanning - parameters are Vertical or Horizontal scan and an option to change the time between each attempt (from milliseconds to hours)

                      if you have something like this please let me know

                      if you want a copy of my UI script interface ping me... and I'll post it here...
                      Attached Files

                      Comment


                      • #12
                        Re: Yes I am a lazy scripter… but I need few things to be done so please help

                        Originally posted by XtaZee View Post
                        I am trying now to write a VBscript that will do port scanning - parameters are Vertical or Horizontal scan and an option to change the time bet
                        nmap just wasn't good enough for you, hmm?
                        Wesley David
                        LinkedIn | Careers 2.0
                        -------------------------------
                        Microsoft Certifications: MCSE 2003 | MCSA:Messaging 2003 | MCITP:EA, SA, EST | MCTS: a'plenty | MCDST
                        Vendor Neutral Certifications: CWNA
                        Blog: www.TheNubbyAdmin.com || Twitter: @Nonapeptide || GTalk, Reader and Google+: [email protected] || Skype: Wesley.Nonapeptide
                        Goofy kitten avatar photo from Troy Snow: flickr.com/photos/troysnow/

                        Comment

                        Working...
                        X