Skip to content

Instantly share code, notes, and snippets.

@LikeCarter
LikeCarter / lenovo_user_presence_sensing.ps1
Last active April 26, 2024 02:08
This script is designed to modify various system settings on Lenovo computers that sleep too quickly or frequently.
# Disable all Lenovo User Presence Sensing
$getLenovoBIOS = gwmi -class Lenovo_SetBiosSetting -namespace root\wmi
$getLenovoBIOS.SetBiosSetting("ZeroTouchLogin,Disable")
$getLenovoBIOS.SetBiosSetting("ZeroTouchLock,Disable")
$getLenovoBIOS.SetBiosSetting("ZeroTouchAllowOverride,Disable")
$getLenovoBIOS.SetBiosSetting("PhysicalPresenceForTpmClear,Disable")
$getLenovoBIOS.SetBiosSetting("UserPresenceSensing,Enable")
(gwmi -class Lenovo_WmiOpcodeInterface -namespace root\wmi).WmiOpcodeInterface("WmiOpcodePasswordAdmin:")
(gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings()
-- Get the Files in Entire Contents of Folder by Extension, then Sort them (AsObjC)
use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
property |⌘| : a reference to current application
property NSPredicate : a reference to NSPredicate of |⌘|
property NSFileManager : a reference to NSFileManager of |⌘|
property |NSURL| : a reference to |NSURL| of |⌘|
ssh -Tvvv git@github.com
$openAsHidden = $false
$openAtLogin = $false
$runningOnClose = $false
$disableGpu = $false
$registerAsIMProvider = $true
function Get-TeamsDesktopConfig() {
$registryPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
$configPath = "$env:APPDATA\Microsoft\Teams\desktop-config.json"
$teamsInstalled = Get-ChildItem -Path $registryPath -Recurse | Get-ItemProperty | Where-Object {$_.DisplayName -eq "Microsoft Teams" } | Select-Object Displayname,InstallLocation,DisplayVersion
Write-Host "Adjusting visual effects for performance..."
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](0x90,0x12,0x03,0x80,0x10,0x00,0x00,0x00))
Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 0
Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0
Try{
Get-AppxPackage -Name "MicrosoftTeams" -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -Online | Where {$_.DisplayName -eq "MicrosoftTeams"} | Remove-AppxProvisionedPackage -Online
Write-Host "Built-In Teams Chat app uninstalled"
Exit 0
}
catch {
$errMsg = $_.Exception.Message
on run
tell application id "DNtp"
if selection = {} then return
my performSmartRule(selected records)
end tell
end run
on performSmartRule(theRecords)
set od to AppleScript's text item delimiters -- Cache the default text item delimiter
system_profiler SPHardwareDataType && sw_vers
This was tested on High Sierra 10.13.
1. Use `mist` - https://github.com/ninxsoft/Mist/releases to download the `.app` installer.
2. Copy to `Applications/`.
3. You need to apply 'Full Disk Access' to Terminal. Settings > Security & Privacy > Full Disk Access then click on the + and locate Terminal.
4. `sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled`
5. Right click the USB and select "Get Info". Expand the Sharing & Permissions, deselect the check box ignore ownership, then click the padlock to save the changes.
Microsoft Teams Calling License Debugging
Troubleshooting:
Can't call outbound phone numbers from Microsoft Teams.
1. Make sure you have a Teams Phone license assigned.
2. Once assigned, create a new phone number from the Teams Admin Centre and assign that number to that user.
"You're not setup to use this calling feature":
1. Make sure Communication Credits license is assigned.
2. Make sure a calling plan (pay-as-you-go) is assigned.