Showing posts with label windows 7. Show all posts
Showing posts with label windows 7. Show all posts
Wednesday, December 26, 2012
Quickie - Enable remote powershell without touching the PC
Quick and convenient way to get WinRM up and running without having to touch the PC. Useful if you prefer to leave it disabled in your environment unless you need it or have decided to deploy it to a number of existing PCs. Use scheduled tasks to enable it for you (note: this isn't my trick, so if you're looking for this you probably already saw it elsewhere, just sans commands!)
PS C:\> schtasks.exe /Create /S ComputerName /TR "powershell -ExecutionPolicy Bypass -Command Enable-PSRemoting -Force" /TN EnablePSRemote /SC MONTHLY /RU "SYSTEM"
SUCCESS: The scheduled task "EnablePSRemote" has successfully been created.
PS C:\> schtasks.exe /Run /S ComputerName /I /TN EnablePSRemote
SUCCESS: Attempted to run the scheduled task "EnablePSRemote".
PS C:\> schtasks.exe /Delete /S ComputerName /TN "EnablePSRemote" /F
SUCCESS: The scheduled task "EnablePSRemote" was successfully deleted.
PS C:\> Enter-PSSession -ComputerName ComputerName
[ComputerName]: PS C:\Users\account\Documents>
Tuesday, June 5, 2012
App-V - Running apps in compatibility mode
Fun fact - you can add App-V virtual drive paths to the compatibility mode registry key and have your virtualized apps run in compatibility mode. Normally, the shortcuts for App-V apps all point to sfttray.exe, so if you try to set compatibility on the generated App-V shortcut, you'll actually be setting it on sfttray.exe for all App-V apps.
Just head over to HKLM/Software/Microsoft/Windows NT/CurrentVersion/AppCompatFlags/Layers. Create a new REG_SZ where the name of the item is the virtualized path (for example, Q:\MyApp.000\MyApp.exe and the value is the compatibility mode (WINXPSP3 for example).
The downside of this (at least so far) is that when I set this to WinXP something trips in the App-V stack to now require admin privs. If I could make that magically go away, this would be a good day.
Just head over to HKLM/Software/Microsoft/Windows NT/CurrentVersion/AppCompatFlags/Layers. Create a new REG_SZ where the name of the item is the virtualized path (for example, Q:\MyApp.000\MyApp.exe and the value is the compatibility mode (WINXPSP3 for example).
The downside of this (at least so far) is that when I set this to WinXP something trips in the App-V stack to now require admin privs. If I could make that magically go away, this would be a good day.
Friday, April 27, 2012
One Liner to Patch an Offline Win7 Image
Keeping the base image for desktop deployments up-to-date with patches is important, if anything to avoid the inevitable super long patch session when it either first comes online or hits the first patch distribution cycle of its life. The other day I was just trying to figure out if it was possible to do it in one line - not because that's necessarily useful (it's not), but mostly because I just like goofy stuff like this. This assumes that you have cab files downloaded via WSUS or some other method and dropped in a directory and that your image is already mounted to F:\WIMMount. Change the "x86" to "x64" if you're patching a 64-bit image.
C:\Program Files\Windows AIK\Tools\x86>forfiles /s /p F:\WSUS\UpdateServicesPackages\ /m *x86*.cab /c "cmd /c dism.exe /image:F:\WIMMount\ /Add-Package /Packagepath:@file"
C:\Program Files\Windows AIK\Tools\x86>forfiles /s /p F:\WSUS\UpdateServicesPackages\ /m *x86*.cab /c "cmd /c dism.exe /image:F:\WIMMount\ /Add-Package /Packagepath:@file"
Subscribe to:
Posts (Atom)