Saturday, October 24, 2020

PowerShell - One Ring to Rule Them All

  


I've been working with PowerShell for a number of years now and suggest that anyone in the IT world should take a look into it.  But even novice PC users can benefit.  PowerShell works with .NET Core which is platform that interacts with the OS and hardware of most programmed devices now.  

If you want to give it a try on your laptop or PC right now, just start typing "powershell" into your search bar right now and click on the blue icon that comes up.  

Type in:   if(!(Test-Path -Path C:\.myinfo )) {New-Item -ItemType directory -Path C:\.myinfo} 

Hit Enter

This will create a new folder on your C drive.  

Next type: Get-ComputerInfo | Out-File C:\.myinfo\ComputerInfo.txt | notepad C:\.myinfo\ComputerInfo.txt 

Hit Enter

This will "Get" the information from your computer's system info and create a shareable/printable text document.  It will then open it up in NotePad for you to view.   You can share it with tech support or use it when buying parts, etc.  Once you close the NotePad, you can go back and get it, should you ever need that info later.  

Find it in your C:\.myinfo folder that you created.   

You can see that the language is understandable to anyone.  "Get" the info, send it "Out" to a file.  Open the NotePad with your new text document displayed.  

Cutting and pasting can be used, but the language and auto-complete suggestions make it easy to use on the fly.  

I'll be adding this quick tip along with others in one of my blog pages, https://big-e-tech.blogspot.com/  which will have entry level to engineer level examples to get people using this amazing tool.

Wednesday, July 26, 2017

Inventory Using AD Module for Powershell



I wanted to go away from so many command shells for fishing information out of AD.

Quest has done well, but I'm in AD PowerShell all the time.


After many modifications, this the refined working method.


Get-ADComputer -Filter * -Property * | Select-Object -Property Name,OperatingSystem,OperatingSystemServicePack,OperatingSystemVersion,LastLogonDate | Sort-Object -Property Name | Export-CSV C:\Apps\Inventory20170726.csv




The properties can be added to, but the "Sort-Object -Property Name" with a chosen value before the "| Export-CSV C:\Apps\Inventory20170726.csv"   seemed to keep the report from becoming a single column of representative numbers.




Thursday, February 11, 2016

Adding Trusted Sites through Group Policy

The necessity for pushing out Trusted Sites arose out of our moving to Office365 for the Office Suite including Outlook and Exchange. 


Microsoft had a long list of sites for that zone. 

Step 1 was manually typing them into a clean PC.  





Step 2 was going into the Regedit.exe and finding the key for Trust Sites. 


It is found by going to: 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
And exporting them to a Shared folder on the Network



Step 3 is to create a Group Policy Object with a Logon Script



The script I made was the following:

IF NOT EXIST "C:\Apps" MD C:\Apps
COPY /B /S /Y "\\ServerName\GPDocuments\domains.reg" "C:\Apps\domains.reg"
REG IMPORT "C:\Apps\domains.reg"

I saved it as a .cmd and then added it to the default location that come up when you choose “Logon,” “Add a Script,” and then “Browse.”   You can just drag you “Add_trusted_sites.cmd” into the location that the browse opened.






This copies the key from the network shared folder to a folder on the PC and then imports it to the registry without any pop ups.

Saturday, October 25, 2014

Exchange 2010 on 365: Manager Access to Mailbox without attaching to Outlook

Add-MailboxPermission –Identity shared@yourdomain.com  -AccessRights FullAccess  -User user@yourdomain.com -InheritanceType all -AutoMapping $false

Exchange 2010 on 365: Add Calendar Read ONLY Permissions

Add-MailboxFolderPermission –Identity shared@yourcompany.com:\Calendar  -AccessRights ReadItems  -User user@yourcompany.com

Thursday, October 23, 2014

Exchange 2010 on 365: Converting a Remote Mailbox to Shared

Open Active Directory Module for Windows PowerShell


Run the following commands to connect with Exchange Server

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
             
Import-PSSession $Session



Then run the following, substituting the user ID with that of your Remote Mailbox



Set-Mailbox -Identity "USER@yourcompany.com" -Type shared