Search found 145 matches

by ITEngineer
Wed Nov 28, 2018 6:55 pm
Forum: Windows PowerShell
Topic: matching and displaying the new values using RegEx and PowerSHell?
Replies: 2
Views: 869

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

jvierra wrote:
Wed Nov 28, 2018 6: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 6:10 pm
Forum: Windows PowerShell
Topic: matching and displaying the new values using RegEx and PowerSHell?
Replies: 2
Views: 869

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 6:15 pm
Forum: Windows PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 1583

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 5:21 pm
Forum: Windows PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 1583

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 4:23 pm
Forum: Windows PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 1583

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 session. A...
by ITEngineer
Wed Nov 21, 2018 3:16 pm
Forum: Windows PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 1583

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 -expandProperty ...
by ITEngineer
Wed Nov 21, 2018 6:18 am
Forum: Windows PowerShell
Topic: PowerShell for checking the SSL certificate validity not working?
Replies: 9
Views: 1583

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 {($_.Extensi...
by ITEngineer
Mon Nov 19, 2018 10:56 pm
Forum: Windows PowerShell
Topic: Exporting Disabled AD user accounts outside specific OU only?
Replies: 4
Views: 1063

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 10:20 pm
Forum: Windows PowerShell
Topic: Exporting Disabled AD user accounts outside specific OU only?
Replies: 4
Views: 1063

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

jvierra wrote:
Mon Nov 19, 2018 10: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.
by ITEngineer
Mon Nov 19, 2018 9:51 pm
Forum: Windows PowerShell
Topic: Exporting Disabled AD user accounts outside specific OU only?
Replies: 4
Views: 1063

Exporting Disabled AD user accounts outside specific OU only?

Hi People, I have created the below PowerShell script, but the result is not always correct. Expected : Only export the Disabled AD account outside the Excluded OU lists to .CSV file. Result : Some OU like CN=Users,DC=Domain,DC=com which also have some Disabled AD accounts are skipped or not even ch...