This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Model | |
{ | |
$Description = Get-WmiObject -Class Win32_OperatingSystem -Computer $Computer -Credential $Credentials | |
$Model = get-wmiobject -class "Win32_Computersystem" -computer $Computer -Credential $Credentials | |
$Ram = ($Model.TotalPhysicalMemory/1GB) | |
$Ram = [Math]::Round($Ram, 2) | |
Write-host | |
Write-host "Computer :" $Model.Name.ToUpper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$users = get-aduser -Filter * -SearchBase #"ou=OU,dc=MYD,dc=local" | |
foreach ($user in $users) | |
{ | |
$person = get-aduser $user -Properties title, department, givenname, surname, displayname | select displayname, title, department, givenname, surname | |
$displayname = ($person.displayname).ToString() | |
$title = ($person.title).ToString() | |
$department = ($person.department).ToString() | |
$givenname = ($person.givenname).ToString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module activedirectory | |
write-host "**************************************************************" | |
Write-Host "`nThis script will tell you what computer a user is logged in to" -ForegroundColor Yellow -BackgroundColor Black | |
write-host "`n**************************************************************" | |
$i = 0 | |
#sets up credentials | |
$myusername = "**DOMAIN**\" + [Environment]::UserName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
###### | |
IMPORT PHOTOS EN-MASSE BASED ON THE PHOTOS BEING NAMED AFTER THE RELEVANT USERS | |
e.g. for staff members Alan Alanson, Barry Barryson, Charles Charleson, | |
the photos would need to be name "Alan Alanson.jpg", "Barry Barryson.jpg", "Charles Charleson.jpg". | |
##### | |
#> | |
$PhotoPath = "\\SERVER\SHARE\photos\Outlook\*.*" | |
ForEach ($PhotoFile in gci $PhotoPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName System.Windows.Forms | |
$NIChecker = New-Object system.Windows.Forms.Form | |
$NIChecker.Text = "Form" | |
$NIChecker.TopMost = $true | |
$NIChecker.Width = 304 | |
$NIChecker.Height = 289 | |
$Label = New-Object system.windows.Forms.Label | |
$Label.Text = "Enter the National Insurance Number below" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT sqltext.TEXT | |
, req.session_id | |
, req.status | |
, req.command | |
, req.cpu_time | |
, req.total_elapsed_time | |
FROM sys.dm_exec_requests req | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle) | |
AS sqltext |