Some silly little powershell notes from a silly little man.
Mapping network printers This one is super duper straightforward. Can probably use it remotely through the command line option on a UEM (Unified Endpoint Management) tool.
Add-Printer -ConnectionName \printer-server\PRINTERNAME Fetching an installer from a URL and install it This one we create a temporary directory, set the URL where the installer can be located, download, then install it. If there’s any switches you want applied to the installer, place them after the /i <installer> portion.
I was investigating what it would take to create a docker container and have the logs go to their appropriate log files in addition to being available via the docker logs command (don’t remember why). During the course of doing that I didn’t accomplish my goal but I did learn that the typical I/O streams of STDOUT and STDERR are the defaults. So it’s essentially just piping those output streams directly to the command.
Spent a good part of the morning working on writing an Ansible playbook to install and setup promtail on a new server, adding it to the central logging setup.
At first I started manually downloading the binary and manually installing it when I remembered I wanted to work on using ansible more. So I stopped where I was and started over again except this time electing to use the power of automation.