Solved

vbscript ucase statement help

Posted on 2016-08-02
3
32 Views
Last Modified: 2016-08-07
I have a script that is running a subroutine and comparing the user account/s in active directory against a list in sharepoint.  It works fine with the exception of a nested group within one of the global groups.  My user id's are all numbers so I'm thinking I may need to specify with a ucase statement but am stuck on what the syntax would be.

Here is the sub routine, "fline=mid(fline,5,len(fline)) " below is where I'm think I need to insert.

Sub getuser(ADUsers,groupname,strpath)
          runline =  "cmd.exe /c dsquery group dc=mcd,dc=pri -name "&groupname&" | dsget group -members > " & Chr(34) & strpath & Chr(34)
          WShshell.Run  runline,0,TRUE
          set ofile=objfso.opentextfile(strpath,1)
          count=0
          Do While Not oFile.AtEndOfStream
                   Fline = oFile.Readline
                   if mid(fline,2,3)="CN=" then
                             endofline=instr(fline,",")-1
                             fline=Left(fline,endofline)
                             fline=mid(fline,5,len(fline)) 'Userid = UCASE(userid)

                             If Not ADUsers.Exists(Fline) Then
                                      ADUsers.add Fline , 0
                             End If
                             count=count+1
                   END if
          loop
          ofile.close
end sub

Open in new window

0
Comment
Question by:Rob Shorts
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 41739583
Have you tried:

fline=UCase(mid(fline,5,len(fline)))

Open in new window

~bp
1
 

Author Comment

by:Rob Shorts
ID: 41739594
Perfect!  Thank you Bill P
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 41739599
Welcome.

~bp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now