GPO etc is not my area of expertise, hence my query :)
I have a powershell script that I run manually to obtain asset details from systems, which works (usually) well.
I figured lets try adding it to grou policy to run on each system upon login.
So have added to GP, linked it to a test OU where my system resides.
According to a GPResult, the GPO is being applied, but Im not seeing any output etc on the desktop or an end result (which should be an email)
Now, Im guessing that its something to do with the powershell script itself that is the issue, something in it dosent play with GP and it just is not running.
Ideas/advice/tips welcome :D
Set-ExecutionPolicy Bypass -Scope Process
echo ""
echo ""
echo "Asset Identification Script now running....... please wait."
echo "This window will close automatically"
$mailParams = @{
SmtpServer = 'xxxxxxmail.protection.outlook.com'
Port = '25'
UseSSL = $true
From = 'xxxxxx@coastguard.nz'
To = 'xxxxxxxx@coastguard.nz'
Subject = "Email from $($env:COMPUTERNAME) at $(Get-Date)"
Body = "This is an automated email sent from $($env:COMPUTERNAME) at $(Get-Date) with Serial Number $(Get-WmiObject win32_bios | select Serialnumber) by $($env:UserName)"
DeliveryNotificationOption = 'OnFailure'
}
## Send the email
Send-MailMessage @mailParams


