Jump to content

thudo

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About thudo

  • Rank
    Newbie
  1. Is this possible? I want to target a specific process name running under its parent and nothing more.I figured this would work: Function KillProcessInProcess()strComputer = "."Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colProcessList = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Process WHERE Name = 'CcmExec.exe' OR Name = 'wscript.exe'")For Each objProcess in colProcessList objProcess.Terminate()NextEnd Function The problem is it will also kill all other wscript.exe process running as well as
  2. Update.. for the community here is my final script that works.. Option ExplicitDim objFSO, arrProfileAge, colFolders, objFolder, intRecord, intDomainAccts, objUser, objGroupSet objFSO = WScript.CreateObject("Scripting.FileSystemObject")Set arrProfileAge = CreateObject("System.Collections.ArrayList")Set colFolders = objFSO.GetFolder("C:\Documents and Settings").SubFolders' Loop through the folders to get the DateLastModifiedFor Each objFolder in colFoldersSelect Case UCase(objFolder.Name)Case "ADMINISTRATOR", "ALL USERS", "DEFAULT USER", "LOCALSERVICE", "NETWORKSERVICE" ' Do Nothing, exclude
  3. Huh? Of course it works in VB -- with the help of an online colleague he built a script for me that does precisely what I need. I'll post it when I come back from the country.
  4. Nobody from this great community re: The VB script simply needs to take the last 3 logged in users based on the date the script is run, and dump those 3 users to 2 specific groups. The 3 users must be designated in a domain when dumped (ie. CORP\test.user).
  5. Anyone have a simple script to pick up the last 3 logged in users to the PC then transfer them to a local security group I chose?
  6. Found out how to get it to work adding domain users to the specific groups. Script looks like: Dim net, local, objUser, objDomain, UserID, ObjNetSet net = WScript.CreateObject("WScript.Network")local = net.ComputerNameobjUser = net.UserNameSet objGroup = GetObject("WinNT://" & local & "/<group to add user to>")Set objUser = GetObject("WinNT://<our domain>/<user to add>")objGroup.Add(objUser.ADsPath) Now I need a script to add the last three logged in users to the PC to a group rather than fixed names as above. Anyone?
  7. Essentially, I've created the following to add to our environment three users to a desktop: BKRADM, CTC_ITSPRT, MUSR_MQADMIN then make two groups: mqm and mqbrkrs, then put those three users into those two groups. My problem is:Based on the script below how do I..1) Add to groups mqm and mqbrkrs the last three logged in users to that local machine I run the vb script on and..2) Manually add in domain users where I want to add to, say, the mqm group a user CORP\tom.jones and CORP\bertha.matt (both users are in our network domain and not local users to the computer so its critical to have the CO
×
×
  • Create New...