9

I'm a VBScript man, but even I've realised that the Windows world has shifted towards Powershell! All the Microsoft products are now extensively supporting Powershell extensions, and it's so much more powerful than VBScript. Embrace powershell!


8

Powershell: Get-WmiObject Win32_Process | Select Name, ProcessId, CommandLine


7

I'd like to preface this by saying that I strongly urge anyone that disables their Windows firewall to take the time to understand how it works and how to manipulate it via GPO instead of outright turning it off. There's no reason to turn off a host-based firewall. Microsoft makes excellent tools to manage firewall rules, you should use them. This TechNet ...


6

It would be much easier if you used Group Policy Preferences to map the drives and did item-level targeting to filter drive maps by group. This is the preferred way.


6

Errr, tidy up your GPOs, and disable it there. Or, at the very least, create a new GPO at the top of the stack (highest precedence) and disable the firewall. Then go back and tidy your other GPOs later. Local Security policy gets overridden by GPOs, and the first area of the registry you're writing to is specifically for GPO processing. Short answer... ...


5

You could use something like the following. It reads the registry key for PowerShell. If the read is successful (return code 0), or not, you get the corresponding message box, which you can switch out for other logic you need to do--like install PowerShell if it's not detected. See the source links below for more info. Option Explicit Dim oShell Dim value '...


5

The right™ way to do this is to use a startup/logon script in GPO or Use a Group Policy File/Shortcut Preference item if your clients are Vista/7 or XP w/ the GPP Extensions add-on. The reason that you don't want to do this the way that you proposed is that if a computer is not on or is unavailable or has a file locked, this won't work. A logon script or ...


5

Windows has the ability to share concurrent access to files through mechanisms such as byte-range locks, whereby a process locks only a certain region of a file, etc. But applications have to be written appropriately to take advantage of this. It is entirely possible to code your application in such a way that you lock the entire file, and not just a region ...


4

What's wrong with looking at the %COMPUTERNAME% environmental variable and pre-pending IUSR_?


4

Certificate Templates are stored in the Configuration partition of Active Directory. For instance, if your Certificate Template is named "Smartcard," then its DN would be: CN=Smartcard,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=Contoso,DC=Com The msPKI-Cert-Template-OID attribute of that object contains the OID you ...


4

If your txt file is just a space-separated list of [computername] [ip-address], you can use the Import-Csv cmdlet: $Computers = Import-Csv -Path C:\file.txt -Delimiter " " -Header Name,IP foreach($Computer in $Computers){ # Query $Computer.Name # Assign $Computer.IP as the static address }


4

Mathias' answer is perfectly suited for the question as asked. A much better, more maintainable way to accomplish the goal, however, is to use a DHCP server with reservations.


3

ADSUtil just uses GetObject under the covers (IIS is exposed as a garden variety ADSI provider), so you can simply target the property you're interested in (if you know the path) with something like set oSite = GetObject("IIS://localhost/W3SVC/1/ROOT") Wscript.echo oSite.AnonymousUserName for the default web site, or this (as in your example above) for the ...


3

The problem is how do you match the account on one side with the account on the other. This will do the extract. Any ideas on how to do the match on the import? Do you have a common field like employeeID in both? Otherwise a complicated multi-field matching might be needed. get-aduser -filter * -searchbase "ou=users,dc=adomain,dc=com" -properties ...


3

You can do this with the following command: wmic /node:"<servername>" qfe get description,fixComments,hotfixid,installedby,installedon,servicepackineffect Where is the hostname of your server. You might want to take a look at WSUS.


3

To disable remote desktop from windows command line run the below command as administrator: reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f To enable remote desktop from windows command line run the following command as administrator: reg add "HKEY_LOCAL_MACHINE\SYSTEM\...


3

It would run longer if you moved to x64. It could use as much memory as you could throw at it before blowing up. In x86, you probably would not even reach the 2 GB process limit before blowing up. Then you could recycle the application pool less often and hopefully after hours when fewer users are impacted. But does it "handle VBScript better or more ...


3

There is an excellent suite of tools called PsTools which includes PsExec. PsExec allows you to remotely execute programs on another machine (or in this case a server). You have to have the appropriate authority/credentials to do so of course. The following psexec command would run the batch file my_batch_file.bat located in directory "C:\batch" (on the ...


3

No. Once a file is opened for writing, it's locked. Other attempts to write while locked will result in "Access Denied." You should consider writing whatever these events are to the local event logs and then use Event Log Subscriptions to pull all of these logs into a central source. From there, you can export it to whatever format you wish.


3

You could simply copy the file to all your machines from an administrator logon. That's more or less what I did. I just did it one at a time, but you could put that in a batch file.


3

I had trouble with finding the distinguished name for a certificate template, so I found a different way than the other answers by following these steps: Open MMC and add the Certificate Templates snap-in (File > Add/Remove Snap-ins > Certificate Templates - you may need to run as administrator to have this snap-in available) Right Click the certificate ...


3

You could use a Powershell Workflow... #Requires –Modules PSWorkflow workflow Shutdown-PCs { $computers = 'computer01','computer02','computer03','computer04' Foreach -parallel ($computer in $computers) { Stop-Computer -PSComputerName $computer -Force -Verbose } } Shutdown-PCs


2

I looked for so long too. I figured out the answer! To check the current state : auditpol /get /subcategory:"Process Creation" This next line will make the change. It will set the process creation to Enabled. auditpol /set /subcategory:"Process Creation" Check the state again and you'll see the change. Alternatively, you could change all of the "detail ...


2

Create a registry file (.reg) with this in it: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] "fDenyTSConnections"=dword:00000001 Then use regedit /s yourregfile.reg If you want to script it better than that, use vbscript: enable or disable rdp (remote desktop) on remote system.vbs If you want ...


2

http://msdn.microsoft.com/en-us/library/t9zt39at(v=vs.85).aspx The EnumNetworkDrives method returns a collection. This collection is an array that associates pairs of items — network drive local names and their associated UNC names. Even-numbered items in the collection represent local names of logical drives. Odd-numbered items represent the ...


2

Yes, yes it should. Network Service is a user-level account at best and AFAIK IIRC will only be able to kill processes it started. If the task is running on the server itself, the easiest way is probably to require Windows Integrated authentication for the page, and ACL it so that only Administrators and System can Read it. That'll ensure that only ...


2

I can recommend you if you have used a vb scripts and then also its not working please go for a third party tool, such as Lepide active directory self service or you can also go for manaengine password reset tool. Both do the same function but Lepide is a freeware tool with the limitation on the numbers of users.


2

is AD not compatibe with .VB Scripting? i cant use GPO as i dont want to run it for the whole company just a few users I'm not sure about your original question, but this is exactly what Group Policy is designed for. Create a GPO and either apply it to the relevant OU's or apply it higher up the tree and use Security Filtering to only include a Security ...


2

You could do this with a one-liner logon script in a Group Policy Object. Just run cmd.exe with the command-line argument /C rd /s /q "%APPDATA%\Juniper Networks\Setup Client".


2

The command vol v: will tell the volume label. The output will be something like this: Volume in drive C is System Volume Serial Number is 86DA-23A0 You might want to write the first line of the output to file like this: vol v:|find "Volume in drive">>drivelog.txt


Only top voted, non community-wiki answers of a minimum length are eligible