Search found 163 matches

by ITEngineer
Wed Jul 03, 2019 9:01 pm
Forum: Windows PowerShell
Topic: Download file using Powershell script no working anymore due to URL change?
Replies: 4
Views: 2206

Download file using Powershell script no working anymore due to URL change?

Hi, Can anyone here please assist me what's wrong with the lines of code below? $Time = Get-Date -format 'F' $DownloadDirectory = "C:\TEMP\JAVA" $DownloadedFiles = Get-ChildItem -Path "$DownloadDirectory\*jre*.exe" -Force | Where-Object {!$_.PSIsContainer} $DownloadedFiles | Remove-Item -Force Try {...
by ITEngineer
Thu Jun 27, 2019 9:11 pm
Forum: Windows PowerShell
Topic: Combine the Get-ADUser Powershell script to produce single result
Replies: 8
Views: 2862

Re: Combine the Get-ADUser Powershell script to produce single result

I did find one error in the code you copied and pasted. Also there is an issue with HomeDB property which the following will overcome. $properties = 'homeMDB,msExchRemoteRecipientType,msExchRecipientDisplayType,msExchRecipientTypeDetails,proxyAddresses' -split ',' $CSVPath = 'C:\Results.CSV' Get-AD...
by ITEngineer
Thu Jun 27, 2019 6:37 pm
Forum: Windows PowerShell
Topic: Combine the Get-ADUser Powershell script to produce single result
Replies: 8
Views: 2862

Re: Combine the Get-ADUser Powershell script to produce single result

Just make sure all properties are included in the query and that all conditions are in the "where" filter. When I modify the script into below, it does not give the result in .CSV file? $properties = 'homeMDB,msExchRemoteRecipientType,msExchRecipientDisplayType,msExchRecipientTypeDetails,proxyAddre...
by ITEngineer
Wed Jun 19, 2019 4:59 am
Forum: Windows PowerShell
Topic: Combine the Get-ADUser Powershell script to produce single result
Replies: 8
Views: 2862

Re: Combine the Get-ADUser Powershell script to produce single result

Hi Mr. Vierra,

Can you show me an example of what you mean?
by ITEngineer
Tue Jun 18, 2019 8:04 pm
Forum: Windows PowerShell
Topic: Combine the Get-ADUser Powershell script to produce single result
Replies: 8
Views: 2862

Combine the Get-ADUser Powershell script to produce single result

Hi People, I need some help in combining the two Power-Shell command to generate the CSV result with the column as follows: Mailbox Location, Name, PrimarySmtpAddress, OU OnPremise, OnPremise User1, OnPremise.User1@domain.com, domain.com/Users/Exchange 2013 OnPremise, OnPremise User2, OnPremise.User...
by ITEngineer
Mon Mar 18, 2019 9:18 pm
Forum: Windows PowerShell
Topic: Unable to call Function to parse the string from AD result
Replies: 4
Views: 1021

Re: Unable to call Function to parse the string from AD result

The result is still an error? #Get Active Directory information for current user $sysInfo = New-Object -ComObject 'ADSystemInfo' $userDN = $sysInfo.GetType().InvokeMember('UserName', 'GetProperty', $null, $sysInfo, $null) $adUser = [ADSI]"LDAP://$($userDN)" [void][Runtime.InteropServices.Marshal]::F...
by ITEngineer
Mon Mar 18, 2019 9:03 pm
Forum: Windows PowerShell
Topic: Unable to call Function to parse the string from AD result
Replies: 4
Views: 1021

Re: Unable to call Function to parse the string from AD result

jvierra wrote:
Mon Mar 18, 2019 8:56 pm
How to format a telephone number:


$n = '2123346789'
'({0}){1}-{2}' -f $n.SubString(0,3),$n.Substring(3,3),$n.SubString(6,4)
That's good to know,

so how can I store that formatted number into a variable called $Formatted ?
by ITEngineer
Mon Mar 18, 2019 8:21 pm
Forum: Windows PowerShell
Topic: Unable to call Function to parse the string from AD result
Replies: 4
Views: 1021

Unable to call Function to parse the string from AD result

I'm unable to call Function to parse the string from AD result using 10x different combination like below? Function Format-TelephoneNumber { Param ( [Parameter(ValueFromPipeline = $true, Position = 0)] [Alias('Number')] [string]$TelephoneNumber, [Parameter(Position = 1)] [string]$DefaultCountryCode ...
by ITEngineer
Thu Mar 14, 2019 9:42 pm
Forum: Windows PowerShell
Topic: Fixing PowerShell script to find AD user account based on Display Name or First.LastName?
Replies: 2
Views: 943

Re: Fixing PowerShell script to find AD user account based on Display Name or First.LastName?

jvierra wrote:
Thu Mar 14, 2019 5:38 am
Get-ADUser -Filter "Surname -eq '$lastName' -and GivenName -eq '$firstname'"
Hm.. yes, that does make sense.
let me integrate to my script.
by ITEngineer
Thu Mar 14, 2019 5:19 am
Forum: Windows PowerShell
Topic: Fixing PowerShell script to find AD user account based on Display Name or First.LastName?
Replies: 2
Views: 943

Fixing PowerShell script to find AD user account based on Display Name or First.LastName?

Hello All, I need some help in fixing the below PowerShell script to search for user samAccountName or Alias or Display Name like First Lastname in Active Directory from input typed by the user: Do { Write-Host -Object 'Enter a samaccountname / Alias or even "First Lastname", or nothing (Press Enter...