If you are scheduling tasks, no doubt you run across the issue that if you need a task run as a different user, said user needs the right to logon as a batch job. Doing this is fairly easy:
- Start secpol.msc
- Expand Local Policies -> User Right Assignment
- Find “Logon as a batch job”
- Add the user / service account as needed
This can of course also be set up via GPO.
- Source: Set Logon as batch job rights to User by Powershell, C# and CMD
I am starting to work more with VS Code, especially since it is so easy now to write PowerShell code on my MacBook Pro, without having to switch to a Windows VM or remote into a Windows machine.
Yet there a few kinks, they are however easy to fix.
- Install Powershell on the macOS
So easy! Go to: https://github.com/PowerShell/PowerShell/releases/
Download the latest PowerShell package for macOS
(It’s the one ending with .pkg)
Allow the package to be run:
System Preferences -> Security & Privacy -> Allow Apps downloaded from
Follow the prompt
- Installing the Powershell Extension
Press ‘Shift+CMD+P’ to open the Command Palett
Type ‘Install Extensions’, select it and press enter
Type in PowerShell, there is currently only a single extension from Microsoft for PowerShell, so that’s the one you should pick.
Click on Install/Enable, restart VS Code, done.
- PowerShell Intellisense issues
It seems to be common issue if there is no OpenSSL installed
Have a read here how to fix it.
- Another issue is PowerShell remoting. Since Windows is using win RM, macOS or Linux know nothing about that. You have to use SSH, specifically OpenSSH. You have to install that on your windows machine which is right now a little bit tricky (step by step here) but eventually they are going to build a cmdlet or something to automate that for you.
Yay bash! Still have not found a good powershell replacement for grep… sure there is ‘select-string’ but meh…
Anyways how to install bash on Windows 10:
- Make sure you have the right version of Windows 10 and the Anniversary Update installed!
- Start -> Settings -> Update & Security -> For Developers -> Activate Developer Mode
- Go with Programs and Features (appwiz.cpl) and click on ‘Turn Windows features on or off’
- You should now see “Windows Subsystem for Linux (Beta)“
- Install it and run bash
- Now the most frustrating part, you have to sign in to the windows store and accept the TOS
12# Alternatively, this should work too!lxrun /install /y
- Once finished you should have “Bash on Ubuntu on Windows”