4 votes

How to check if a specific list of user accounts are disabled in AD, using powershell v2.0 or CMD / VBS

PowerShell Get-ADUser -Identity SamAccountName returns the user object for SamAccountName. To get the enabled property, use: Get-ADUser -Identity SamAccountName | Select-Property Enabled. ...
Jeter-work's user avatar
3 votes
Accepted

Keep using IE11 functionality after expiry

Internet Explorer will be disabled in Windows on June 15 2022, so you technically will not be able to start Internet Explorer after this date in Windows 10 20H2+ (starting iexplore.exe will open Edge ...
Swisstone's user avatar
  • 6,750
3 votes
Accepted

Shutdown domain PC's in bulk ASYNCHRONOUSLY

You could use a Powershell Workflow... #Requires –Modules PSWorkflow workflow Shutdown-PCs { $computers = 'computer01','computer02','computer03','computer04' Foreach -parallel ($computer in $...
Mike1980's user avatar
  • 1,018
3 votes

How can I get an OID for a certificate template?

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 ...
chillNZ's user avatar
  • 31
2 votes

How can I edit local security policy from a batch file?

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 ...
OatBoat's user avatar
  • 21
2 votes
Accepted

Windows Registry to VBS

This was answered to a degree here at Super User but I recommend using reg query, reg import and reg add in MS-DOS/Command Prompt. EDIT: To elaborate, you can manually add the keys one by one or you ...
Michael Bailey's user avatar
2 votes

Run Bat file in Administrator Mode in Windows Server 2008

The problem with coding an administrator password into the script file is that you're exposing said password directly to the user. If you don't mind doing that, you're actually better off just giving ...
Kara Marfia's user avatar
  • 7,892
2 votes

vbs to detect usb drive and run some commands

VBScript: please read Rob Haupt's five VBScript 'best practices' and Rob van der Woude's Debugging Your Scripts; in short: use Option Explicit statement always (if used, the Option Explicit statement ...
JosefZ's user avatar
  • 1,564
2 votes

Using Vbscript/PowerShell How to check if an AD user account has permissions to modify AD group membership?

I can't comment yet, but I agree with Ryan Boldger. I did find someone who wrote a module to do just this, but it's quite old. Here's the link if you want to look: https://stackoverflow.com/...
Scott Heath's user avatar
2 votes

Retrieve user details from Active Directory using SID

Use PS: $SID = "S-X-X-XX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXXX" Get-ADObject -IncludeDeletedObjects -Filter * -Properties * | where{$_.objectSid -eq $SID}
2 votes
Accepted

How to check if a specific list of user accounts are disabled in AD, using powershell v2.0 or CMD / VBS

It seems I missed a *. The correct code is: dsquery * -Filter "(userAccountControl:1.2.840.113556.1.4.803:=2)"
DSKyo's user avatar
  • 153
1 vote
Accepted

How do I fix "No usable signing certificates are available" in VBA?

Sorry, I'm not a big expert here, but will still try to add my 5 cents... First of all, have you tried self-signed certificate? It is easier to debug, will help you test locally. https://social....
Alex's user avatar
  • 186
1 vote

How to select using script on Task Scheduler the "run with highest privileges"

You can accomplish this with the -RunLevel Highest flag for New-ScheduledTaskPrincipal in PowerShell. Example: # Set the scheduled task time and repitition $TaskTime = New-ScheduledTaskTrigger -Daily -...
Josh Zhang's user avatar
  • 159
1 vote

How to get a list of Domain Admin users from a windows 2003 DC

Try this: dsget group <group DN> -members -expand > Group_Members.txt The created document now contains the DN of each member of the group. You can then use this to get more details for each ...
Ben Lavender's user avatar
1 vote

Any PowerShell Script to Backup and restore Ms-sql database using dB username and password?

You can use Backup-DbaDatabase cmdlet from dbatools, you just need to install the module first and then set the -SqlCredential parameter with the username and password. Lots of examples out there.
Peter Hahndorf's user avatar
1 vote
Accepted

Logon VBS script will not start programs

As Pimp Juice IT pointed out, I can also do this in User Configuration | Admin Templates | System | Logon | Run these programs at user logon. To get past the "Do you want to run this script" ...
Canadian Luke's user avatar
1 vote

Get list of Outlook Favorite Item via Powershell

I found a similar thread for your reference: Get list of Outlook Favorite Item via Powershell The script to fix your problem is similar with jfrmilner's: $OutlookObject=New-Object -ComObject Outlook....
Ivan_Wang's user avatar
  • 1,333
1 vote
Accepted

Get list of Outlook Favorite Item via Powershell

This code will list Favorites $ol = New-Object -ComObject Outlook.Application $ex = $ol.Application.ActiveExplorer() $mm = $ex.NavigationPane.Modules.GetNavigationModule(0) $favorites = $mm....
jfrmilner's user avatar
  • 476
1 vote

How to find vbscripts running on Windows Servers

I don't know if my old vbscript can help you in your case or not : So this vbscript will generate an Excel file as report where you will find many useful informations like : All Tasks, No Microsoft ...
Hackoo's user avatar
  • 115
1 vote

How to find vbscripts running on Windows Servers

I'd search for scheduled tasks that run scripts, and if you have AV or FSRM on the servers, I'd set it up to log when the scripting host runs, or a vbs/wsf file is opened.
Chris's user avatar
  • 955
1 vote

logon script applied but not running

Try writing a file instead of echoing to a console. Depending on how things are set up, it could be running in a hidden session you never see, or just finishing so quick and then closing you miss it. ...
Joel Coel's user avatar
  • 12.9k
1 vote

A positional parameter cannot be found that accepts argument 'WScript.CreateObject'

Looks to me like you're just running into trouble translating the VBS code into powershell. There are some subtle syntactic differences such as: $WSH = New-Object -Com wscript.shell $WSH.run("...
Colyn1337's user avatar
  • 2,397
1 vote

Add printer VBS Script SWbemObjectEx Access denied

Is this a user or machine GPO Policy? I would suspect if it is user that the actual user might not have permissions to add the printer. You could try to follow this guide from MSDN's blog to give the ...
PHELMS's user avatar
  • 92
1 vote
Accepted

VBScript MID function - Invalid procedure call or argument - Code 800A0005

All occurrences of MID function in your code follow syntax pattern Mid(string, start[, length]) properly: Arguments string String expression from which characters are returned. If string ...
JosefZ's user avatar
  • 1,564
1 vote

RUN exe file with a script on Windows 7 32bit

Try placing the end quote differently: "C:\Program Files\Google\Chrome\Application\chrome.exe" --kiosk-printing
Jeff's user avatar
  • 236
1 vote

psexec cannot run .vbs local or unc

Ok I figured it out. Had to take out -s switch. -used cscript used cscript /nologo switch. psexec -u user@domain -p password \\computer cscript /nologo "\uncpath\file.vbs"
Benjamin Jones's user avatar
1 vote

SCCM+ MS Office 2013 deployment

Well to deploy a script or application is the same in SCCM. Assuming SCCM is already configured you need to setup your application files and deployment packages. The wizards in SCCM are pretty ...
Jesus Shelby's user avatar
  • 1,294
1 vote

VBScript- Input DisplayName Output AD Username

If your text file is 1 name per line and you know they show up exactly like they do in AD. Get-Content Names.txt | Get-Aduser -filter {Name -eq '$_'} | select Name,Samaccountname At least thats a ...
Unfundednut's user avatar
1 vote

App-V 5; change file after package install

It feels like you've jumped a few steps that 'ought' to work, but are missing somethnig somewhere. How are you sure the .MSI is consuming the .XML? Personally I'd experiment with the PoSH commands ...
BenjiAppFactory's user avatar
1 vote

VBScript wont run for domain user on Windows Server 2008 R2

I solved this problem on a windows server 2012R2 machine by creating the following key in the registry HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script Host\Settings And then granting full ...
Gary Brunton's user avatar

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