Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Tuesday, August 4, 2015

Lync 2013 Client With OCS Registry Hack, The PowerShell Way

I have been formatting my desktop quite a bit these days. And I realised that each time I format, I need to do all the usual stuff and hacks to get things working the way it did. One of them, is of course, the registry hack to get Lync 2013 to connect to the OCS server at my company.

So I decided to do this the powershell way. Turns out it was just 2 really simple commands:
New-Item HKLM:\SOFTWARE\Policies\Microsoft\Office\15.0\Lync -Force
New-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Office\15.0\Lync -Name DisableServerCheck -Type DWord -Value 1

Do remember that you have to run PowerShell with Administrator rights.

UPDATE: Now that skype for business 2016 is launched, it's time to update the script a little. Use this one below instead.
New-Item HKLM:\SOFTWARE\Policies\Microsoft\Office\16.0\Lync -Force
New-ItemProperty HKLM:\SOFTWARE\Policies\Microsoft\Office\16.0\Lync -Name DisableServerCheck -Type DWord -Value 1

Friday, May 30, 2014

Junos Pulse native VPN client on Win 8.1 (Advance configuration)

I just discovered another new thing about connecting to juniper networks SSL-VPN.

So the company I work for has multiple "sign on policy path" for our vpn, as the official documentation from juniper puts it. Normally, everyone is expected to go to the full official URL in the browser to connect to the VPN. Connection will require ActiveX, Java, and the right browser to start working.

Windows 8.1 came with a native VPN client, which was a good thing. But unlike the client in iOS, the server field does not take in a url. Hence, I can only connect to the default VPN path, but not to https://vpn.contoso.com/admin

Turns out, the way to do this is only through PowerShell. So let's get straight to the code:

$xml = '<pulse-schema><uri>/admin</uri></pulse-schema>'
$sourceXml = New-Object System.Xml.XmlDocument
$sourceXml.LoadXml($xml)
Add-VpnConnection -Name 'AdminVPN' -ServerAddress 'vpn.contoso.com' `
    -PluginApplicationID "JuniperNetworks.JunosPulseVpn_cw5n1h2txyewy" `
    -CustomConfiguration $sourceXml -SplitTunneling

The "SplitTunneling" is useful is you only want to route VPN network traffic through the adapter. For my case, the admin VPN of my organization doesn't have a gateway to the internet, hence split tunneling is necessary.

Turns out there are more configuration options for the XML. Here are those that are supported:

Tuesday, April 8, 2014

PowerShell, Task Scheduler, and Start in options

I just realised after lots of twist and turns that when scheduling a powershell job, the Start in value will not work if I just put the Program as "powershell.exe". If "Run with highest privileges" is checked, the working directory of your script will just be "C:\Windows\System32" regardless of what value you put in Start in. Just like it would if you launch powershell as administrator from the start menu. I haven't tried this, but I guess if it's not checked, the working directory should be %HOMEDRIVE%%HOMEPATH%

To solve the problem, just change the Program value to the full path. In my case, this is "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe". Quite a handful to type, but it's the only way I managed to get it to work so far. If there are any better suggestion, I'd be glad to hear.

Monday, December 9, 2013

Of PowerShell, dotNET, and unblocking DLLs

I've been trying like crazy to get my System.data.SQLite to load into Powershell. I tried all the versions, checked and double checked versions and dependencies...

At the end, the solution was super simple. Right-click, properties on the downloaded zip package, and click UNBLOCK. Damn you security feature, wasted half a day just figuring this out!