Skip to content

Instantly share code, notes, and snippets.

@ju2wheels
ju2wheels / sudoers_disable_requiretty.sh
Created October 2, 2014 01:50
sudoers_disable_requiretty.sh
#!/bin/bash
/bin/sed -i 's/requiretty/!requiretty/' /etc/sudoers;
powershell -command "& {set-executionpolicy -force unrestricted; $wget = New-Object System.Net.WebClient; New-Item -ItemType directory -Path 'c:/post_install'; $wget.DownloadFile('https://gist.github.com/ju2wheels/074eaf81e40ed8ffe106/raw/a49cebe0d63768c55e4fa6b998a84d5e3bd0d92d/windows_os_info_collect.ps1','c:/post_install/post_install.ps1'); c:\post_install\post_install.ps1}"
$FormatEnumerationLimit = 10000;
$os = Get-WmiObject Win32_OperatingSystem;
$dotNetInstalled = @{};
$dotNetVersions = @();
$hotFixInstalled = @();
$installedProducts = @{};
$dotNetInstalledString = "[";
Enable-PSRemoting -Force;
Set-WSManQuickConfig -Force;
Set-Item "WSMAN:\LocalHost\MaxTimeoutms" -Value "1800000";
Set-Item "WSMAN:\LocalHost\Client\AllowUnencrypted" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Basic" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Digest" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Kerberos" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Negotiate" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Certificate" -Value $true;