Custom Search Box

Saturday, May 30, 2020

Setting Windows 10 Taskbar Clock to Display Hours, Minutes, and Seconds Using Powershell

It is not possible currently to set the clock on your Windows 10 taskbar using control panel settings to display seconds along with the hour and minute. However there is a way to do it using Powershell:

New-PSDrive HKU Registry HKEY_CURRENT_USER

$registryPath = "HKU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"

$Name = "ShowSecondsInSystemClock"

$value = "1"
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType DWORD -Force


Thursday, May 14, 2020

Tizen Studio - Importing a project from another computer or from Github

Tizen studio can be a bit confusing so I have made a quick guide to importing your project into Tizen studio from a download from Github or another git repo.

File > Import


Select Tizen/Tizen Project


Select Archive file
Find your .wgt file and select it
Click finish

GUI vs CLI (Graphical User Interface vs Command Line Interface)

Sometimes it is better to use the CLI to make changes to users. Some common use cases are AD, Exchange, and on-prem Skype for business.

Shared email accounts in exchange do not show the Send-on-behalf permission within the ECP GUI, however this property still exists and can cause problems for users trying to send on behalf of a shared email account.

Set-Mailbox "SharedMailbox" -GrantSendOnBehalfTo @{add="Mailbox_needing_permission"}

Sometimes in Skype for business, the GUI will not successfully apply changes. Sometimes this is due to AD accounts
not having security settings inheritance turned on. If you run a command like the below, it should have no issue applying the settings:

Enable-csuser -Identity contoso\user -Sipaddress SIP:desired_sip_address@contoso.com -RegistrarPool skype-pool-name

Friday, May 8, 2020

A new sequence of posts

It has been quite some time since I last posted. I will be switching over to tech-related topics from now on in my spare time.

Feel free to comment with any questions or suggestions.

Below is a script that I use to process terminations based on how the auto-emailed notifications come into my inbox:

#***This must be run with outlook closed***
#This script can be modified to filter emails and write their contents to a .txt file
#This script is in two sections
#Parameters
#This is the email account you are trying to search within
$Account = "quinn.favo@contoso.com"
#This is the email folder to search
$Folder = "Inbox"
#Variable used to search the body of emails, enter as a string whatever phrase of text you are looking for, the asterisks should be present at the beginning and end of the string
$BodySearch = "*Account Termination Request*"
#Counter for how many emails were received that match the above parameters, this will be printed at the end of the script to verify success and how many emails were committed to the .txt file
$EmailCheck = 0

#This assigns the path of your current desktop to a variable to be used later
$DesktopPath = [Environment]::GetFolderPath("Desktop")

#Create outlook COM object to search folders
$Outlook = New-Object -ComObject Outlook.Application
$OutlookNS = $Outlook.GetNamespace("MAPI")

#Get all emails from specific account and folder
$AllEmails = $OutlookNS.Folders.Item($Account).Folders.Item($Folder).Items
#Filter emails based on the previously specified string in #Bodysearch
$ReportsEmails = $AllEmails | Where-Object { ($_.HTMLBody -like $BodySearch)}

#Count number of emails that contain the string specified in #Bodysearch
$ReportsEmails | ForEach-Object {$EmailCheck = $EmailCheck + 1}

#Display number of emails found
Write-Output $EmailCheck
#Write the contents of the body from each email to a txt on the desktop
$ReportsEmails.Body | Out-File $DesktopPath\emails.txt

#Quit Outlook COM Object
$Outlook.Quit()

#Kill Outlook after finishing script(allows you to open outlook again)
Stop-Process -Name "OUTLOOK" -Force

#Run the below in the second step
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#Exchange CLI
#Save the emails.txt file to the exchange desktop
#Run the below on exchange server with AD module installed

#Grab desktop path
$DesktopPath = [Environment]::GetFolderPath("Desktop")

$EnableUsers = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("UserID:") }
Write-Output $EnableUsers
$Manager = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("@contoso.COM") }
Write-Output $Manager
$Ticket = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("19") }
Write-Output $Ticket

$Date = Get-Date
$i = 0

#Iterate through users pulled from ticket notification emails
#This will get the name of the user in each email and assign it to the variable $TermUsers
$TermUsers = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("UserID:") }
Write-Output $TermUsers
#This will get the name of the user's manager and assign it to the $Manager variable
$Manager = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("@contoso.COM") }
Write-Output $Manager
#This will get the ticket# starting with 19(or whatever number you specify) and assign it to $Ticket
$Ticket = Get-Content $DesktopPath\emails.txt | Where-Object { $_.Contains("19") }
Write-Output $Ticket

$Date = Get-Date
$i = 0

#Iterate through users pulled from ticket notification emails
ForEach ($UserID in $TermUsers) {
    $Var = 5
    Write-Output $UserID.substring(9)
    $Var = Get-ADUser $UserID.substring(9) -Properties *
    #Check if AD user exists
    If ($Var -ne 5) {
        #If enabled - disable account, modify description, forward email, and hide from Address Book
        If ($Var.Enabled = "True") {
            $Tick = $Ticket[$i]
            $Man = $Manager[$i]
            $Man = $Man.Substring(1)
            Set-ADUser $Var -Description "$($Var.Description) Quinn Favo disabled $Date ticket# $Tick" -Enabled $False
            #-DeliverToMailboxAndForward is set to $False because setting it to true will cause delivery to the forwarding mailbox as well as the original mailbox
            Set-Mailbox -Identity $Var.Name -HiddenFromAddressListsEnabled $true -DeliverToMailboxAndForward $False -ForwardingAddress $Man
        }
        #Disabled, move on to next account
        Else {
            Write-Output "$UserID is already disabled"
        }
    }
    #If doesn't exist in AD, display output
    Else {
        Write-Output "User does not exist"
    }
    $i ++
}