Search found 216 matches

by ITEngineer
Thu Dec 06, 2018 5:21 am
Forum: PowerShell
Topic: Running Powershell with no Command Prompt display as logon script?
Replies: 6
Views: 4724

Running Powershell with no Command Prompt display as logon script?

Hi, Is there any way to run the below script with some additional checking to skip the uninstallation when the AppX is not even listed? Note: the script is also modified (but failed) to not show anything on the user screen. $t = '[DllImport("user32.dll")] public static extern bool ShowWind...
by ITEngineer
Wed Nov 28, 2018 5:55 pm
Forum: PowerShell
Topic: matching and displaying the new values using RegEx and PowerSHell?
Replies: 2
Views: 1943

Re: matching and displaying the new values using RegEx and PowerSHell?

jvierra wrote: Wed Nov 28, 2018 5:46 pm Why so much code:

'+31 ' + '0123456789' -replace '^0'
Yes, that works really well :)

This is part of the email signature script that I am working on.

Thanks for the suggestion Mr. Vierra
by ITEngineer
Wed Nov 28, 2018 5:10 pm
Forum: PowerShell
Topic: matching and displaying the new values using RegEx and PowerSHell?
Replies: 2
Views: 1943

matching and displaying the new values using RegEx and PowerSHell?

Hi All, I need to reformat the value of $ADUser From: 0123456789 Into: +31 123456789 Without the leading 0 component. The below snippet is what I have come up with, but it is still not working with the RegEx section to segregate the 0 section. $ADUser = '0123456789' $(If ($ADUser) { If ($ADUser.ToSt...
by ITEngineer
Wed Nov 21, 2018 5:15 pm
Forum: PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 4626

Re: PowerShell for checking the SSL certificate validity not working?

Yes, that's right, you are awesome.
it works very well.

Many thanks for the suggestion and the assistance in this matter Mr. Vierra. 8-)
by ITEngineer
Wed Nov 21, 2018 4:21 pm
Forum: PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 4626

Re: PowerShell for checking the SSL certificate validity not working?

Mr. Vierra,

Yes, I will do some more research.
I'm not a programmer, but interested to know and use PowerShell for my daily System Automation.

Thanks for the tip and have a great day. :)
by ITEngineer
Wed Nov 21, 2018 3:23 pm
Forum: PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 4626

Re: PowerShell for checking the SSL certificate validity not working?

"$computers" is not a name or an array of names. It is null. Look at the code I posted above. I noted that I reformatted it so you could read it easier but you didn't look at it. You cannot output from both ends of a pipeline. The export eats all of the data so none gets sent back to the ...
by ITEngineer
Wed Nov 21, 2018 2:16 pm
Forum: PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 4626

Re: PowerShell for checking the SSL certificate validity not working?

Take a very close look at your command. By formatting it correctly it is easy to see what you are doing wrong. $computers = Get-ADComputer -Filter {Enabled -eq $True} -SearchBase "OU=Servers,OU=Production,DC=Domain,DC=com" | Select-Object -expandProperty DnsHostName | Select-Object -expan...
by ITEngineer
Wed Nov 21, 2018 5:18 am
Forum: PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 4626

PowerShell for checking the SSL certificate validity not working?

People, I have used the DOMAIN\Administrator account is used for the credentials to run the below powershell script to scan for Expired SSL certificate: $ScriptBlock = { Get-ChildItem Cert:\*\My -Recurse | Select Subject,DnsNameList,NotAfter,NotBefore,Thumbprint,Issuer, @{n="SAN";e={Try {(...
by ITEngineer
Mon Nov 19, 2018 9:56 pm
Forum: PowerShell
Topic: Exporting Disabled AD user accounts outside specific OU only?
Replies: 4
Views: 2704

Re: Exporting Disabled AD user accounts outside specific OU only?

Get-ADUser -Filter {Enabled -eq $false} -Properties CanonicalName, lastlogondate | Where-Object{ $_.SamAccountName.Length -eq 7 -and -not ($excludeOUs -match $_.DistinguishedName) } Ah, I see, But the Disabled AD account in the Users Container is still not reported? how to include this CN: CN=Users...
by ITEngineer
Mon Nov 19, 2018 9:20 pm
Forum: PowerShell
Topic: Exporting Disabled AD user accounts outside specific OU only?
Replies: 4
Views: 2704

Re: Exporting Disabled AD user accounts outside specific OU only?

jvierra wrote: Mon Nov 19, 2018 9:11 pm There is no such parameter as "parentContainer"
No, it was just the column name on the .CSV
so how to fix the script so it is filtering properly.