Solved

vbscript ucase statement help

Posted on 2016-08-02
3
27 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 51

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 51

Expert Comment

by:Bill Prew
ID: 41739599
Welcome.

~bp
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

10 Experts available now in Live!

Get 1:1 Help Now