Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. DJX995

    Call Subroutine Asynchronously

    Ok, This is on a domain controller so looks like I'll have to start digging through Group Policy: "Local Policies/User Rights Assignment" I had to add the user to: "Log on as a batch job" to get this to run initially. I wonder if more is needed.
  2. DJX995

    Call Subroutine Asynchronously

    Actually, now that I'm trying to put this into production, the script is dying. Seems that the unprivileged user I'm running this script as dies at this statement: objWMIServiceRoot.ExecNotificationQueryAsync objSink, "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA...
  3. DJX995

    Call Subroutine Asynchronously

    UPDATE: Please disregard that last comment. I had some typos when I adapted it to my application. This code works exactly as I need. You are the best, thank you.
  4. DJX995

    Call Subroutine Asynchronously

    Thanks for the code. From looking this over and then trying it out real quick, I believe this allows it to run async, but it's only executed once. I'm basically trying to execute two things at the same time and loop them forever. One loops as fast as it can, the other loops every 5 minutes.
  5. DJX995

    Call Subroutine Asynchronously

    I have the following code that creates a process and then continually checks to make sure it's still running. If it finds that it is closed, it creates it again and then loops forever. Set objWMIServiceWin32Process = GetObject("WinMgmts:\\.\root\cimv2:Win32_Process")...
  6. DJX995

    SCHTASKS, Variables, & Escaping

    Fixed: SETLOCAL ENABLEDELAYEDEXPANSION SET strShutdownPath=%SystemRoot%\System32\ SET strShutdownProgram=shutdown.exe SET strShutdownComment=A shutdown has been initiated. The system will shutdown in thirty (30) seconds. IF EXIST "%SystemRoot%\System32\schtasks.exe" ( ECHO Task Scheduler...
  7. DJX995

    SCHTASKS, Variables, & Escaping

    I working on a small script here and I'm having trouble getting it to escape correctly. Here's what I'm dealing with: SET strShutdownPath=%SystemRoot%\System32\ SET strShutdownProgram=shutdown.exe SET strShutdownComment=A shutdown has been initiated. The system will shutdown in thirty (30)...
  8. DJX995

    Create UNC Directory Tree

    Lol, Nice...
  9. DJX995

    Create UNC Directory Tree

    Great, thanks man. I think we now have the smallest way to do this. Here's what it looks like all together: Sub CreateFolderTree(strTempPath) If Not objFSO.FolderExists(objFSO.GetParentFolderName(strTempPath)) Then CreateFolderTree(objFSO.GetParentFolderName(strTempPath)) End If If...
  10. DJX995

    Create UNC Directory Tree

    I'm tring to use this function, that I found here: Sub CreateFolderTree(strTempPath) On Error Resume Next If strTempPath <> "" Then If Not objFSO.FolderExists(objFSO.GetParentFolderName(strTempPath)) Then Call CreateFolderTree(objFSO.GetParentFolderName(strTempPath)) Else...
  11. DJX995

    IsUserAdmin Function

    I was able to figure it out. This is the main function: Function IsUserAdmin(strUser) IsUserAdmin = False Set objAdminGroup = GetObject("WinNT://" & strComputerName & "/Administrators,group") For Each objAdminMember In objAdminGroup.Members If objAdminMember.Name = strUser Then...
  12. DJX995

    IsUserAdmin Function

    Okay, to recap here: Nothing so far has worked the way I originally wanted to. I've done some searching around and can't really peice together what I need to do. Starting from scratch, here is what I would like to do: Function IsUserAdmin(strUser) IsUserAdmin = False Set objAdminGroup =...
  13. DJX995

    IsUserAdmin Function

    I see what you're getting at and I guess we could but it would be a mess. This needs to be installed on specific machines (I don't get to choose) for a few days then it has to be taken off untill next year when we do it again. We would really like to have the ability to install at will. Probaly...
  14. DJX995

    IsUserAdmin Function

    I see, okay well...not very usefull since I'm tring to script an installer (don't want the end user to have to figure out all the groups he is in) but okay. I'm tring to do this function internally without user intervention. I guess what I really need then is some way of enumerating all the...
  15. DJX995

    IsUserAdmin Function

    I think I'm missing something here... Could you please post an example? The way I understand it (I believe this is wrong) is that I have to hard code the group I want to check for? If that's true then it's not universal. I understand checking a user in a group because the user name is a var...
  16. DJX995

    IsUserAdmin Function

    I guess that would solve the problem but it's not the ideal solution. I really wanted it to be more universal...so that I would be able to deploy this function in different environments without having to worry about the actual names.
  17. DJX995

    IsUserAdmin Function

    No luck guys...Even the WMI method still does not detect the user as admin. Like I said before, the user I'm tring to check is a member of a a domain group that is a member of the local admins group on the machine. I've tried both methods (WMI and WinNT Query) Any one else have a suggestion...
  18. DJX995

    IsUserAdmin Function

    Thanks guys, I'll give "tsuji"'s a try when I have time and let you know. The reason I can't just do a simple check like "markdmac" suggested is becuase the user I'm tring to check is a member of a domain group that is inside the local admins group. That's why I was going to try the WMI method...
  19. DJX995

    IsUserAdmin Function

    Yes
  20. DJX995

    IsUserAdmin Function

    I'm tring to work on this function but I'm getting a syntax error (0x80041002). Here is what I pieced together so far: Function IsUserAdmin(strUser) Set objWMI = GetObject("WinMgmts:\\" & strComputerName & "\root\cimv2") For Each objItem In objWMI.ExecQuery("ASSOCIATORS OF...

Part and Inventory Search

Back
Top