Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vbscript ucase statement help

Posted on 2016-08-02
3
Medium Priority
?
48 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 59

Accepted Solution

by:
Bill Prew earned 2000 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 59

Expert Comment

by:Bill Prew
ID: 41739599
Welcome.

~bp
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

916 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