Saturday, June 19, 2021

Life: So sad after accidentally breaking bird eggs

I cannot express enough how sad I am feeling right now. I just returned home from a walk. Our Christmas wreath was still on our door, and for some reason today I decided to take it down. Probably because this was the first time I returned home without my hands full. Because the wreath hung over my head, I grabbed it from the bottom and flipped it upside-down... then suddenly there were a couple splats. I thought it was bird poop, but at closer inspection after I put down the wreath... I noticed they were two tiny eggs.

I feel so sad for the birds. And suddenly a couple puzzle pieces came together. I now recall that there is always a bird that flies away when I open or walk by the door. I know it won't do anything but I put the wreath back but on the ground. I made sure it was rightside-up just in case there were other eggs left in the wreath. It was dark so I couldn't tell. I also just read that most birds won't return if their nest was disturbed so it will unlikely return.

Now I know to take down winter ornaments right away. Sadly, I feel I will remember this every year now.

Saturday, June 12, 2021

Info: Getting network shares library with C#

Goal: to get a list of available shared folder names given a remote server name. 


1. I believe this uses the user that is logged into the site. https://www.codeproject.com/Articles/2939/Network-Shares-and-UNC-paths

This was super easy to set up.


2. This is what I wrote if logging in with a specific user:

ManagementPath path = new ManagementPath();

            ManagementClass shares = null;

            ConnectionOptions co = new ConnectionOptions();

            co.Username = "login";

            co.Password = "password";

            co.Impersonation = ImpersonationLevel.Impersonate;

            path.Server = FolderPath; //"devaappwebec01"; // use . for local server, else server name

            path.NamespacePath = "root\\CIMV2";

            path.RelativePath = @"Win32_Share";

            ManagementScope scope = new ManagementScope(path, co); // use (path) for local binds

scope.Connect();

ManagementObjectSearcher worker = new ManagementObjectSearcher(scope,

            new ObjectQuery("select Name from win32_share"));

            ManagementObjectCollection moc = worker.Get();

 



Sunday, June 6, 2021

Info: Command to get OS version from remote server

WMIC /user:domain\userId /password:userPassword /node:remoteServerName os get buildnumber,caption,CSDVersion /format:csv