Search found 262 matches

by sekou2331
Mon Jan 08, 2018 2:57 pm
Forum: Windows PowerShell
Topic: Multicast Listner error
Replies: 7
Views: 900

Re: Multicast Listner error

I know the local IP is wrong I just added that as filer. I think I see it now. I added the below lines. Seems to fix the issue. $mCastSocket.ExclusiveAddressUse = false; $mCastSocket.SetSocketOption([System.Net.Sockets.SocketOptionLevel]::Socket, [System.Net.Sockets.SocketOptionName]::ReuseAddress, ...
by sekou2331
Mon Jan 08, 2018 1:39 pm
Forum: Windows PowerShell
Topic: Multicast Listner error
Replies: 7
Views: 900

Multicast Listner error

His so I wrote this code and I keep getting error that I just cant seem to figure out. It is not happening in case though. Maybe it is something that I am not seeing. I am getting the error below. Exception calling "ReceiveFrom" with "2" argument(s): "You must call the Bind method before performing ...
by sekou2331
Wed Dec 13, 2017 5:24 am
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

First let me say thanks jvierra for helping i am sorry it was a bit confusing. With that being said I didn't use ConvertFrom-StringData to parse or get the data because there were keys with the same name from my understanding and the errors from my console so it forced me to go another route as you ...
by sekou2331
Tue Dec 12, 2017 1:46 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

Sorry but I dont know how ConvertFrom-StringData is going to help me. If I am confusing you I am sorry. If you look at the code I am parsing an ini file by selecting on two strings Primary and Secondary. Then from there I am removing everything that is not needed. Then I am storing it in $collected_...
by sekou2331
Tue Dec 12, 2017 11:22 am
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

Thanks last question. Why am I only get one line back? it is not iterating through my array. Using the code below. $ConfigFile = sls -path .\file.ini -Pattern 'Primary', 'Secondary' -SimpleMatch $collected_parsed_items = @() foreach ($a in $ConfigFile.line) { if (!( $a -match "remove1" -or $a -match...
by sekou2331
Tue Dec 12, 2017 5:42 am
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

Thanks for your help I have parsed the ini files as needed now i have an array of objects "System.Object[]". What I want to do is for every three objects in the array create a string. I tired the below but it is breaking it up multiple times. foreach ($i in $collected_parsed_items){ "$($i[0]) $($i[1...
by sekou2331
Sat Dec 09, 2017 7:22 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

Ok after working on it I was able to parse the ini file and get the information i needed by using the below code. I don't know if this is the best method. But it gives me the below the only thing I am having an issue with is taking 3 of the string and making it one string. i used a foreach and then ...
by sekou2331
Fri Dec 08, 2017 4:56 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Re: Parsing ini file and adding it to a CSV file

Ok so I hope this is a better question. In the ini file there are multiple section like the below. How can grab everything that say primary and keep it in the order that it is in for each section? So basically using this example below grab everything from Primary_need1=something1 to Primary_Recovery...
by sekou2331
Fri Dec 08, 2017 4:01 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 2254

Parsing ini file and adding it to a CSV file

I am trying to parse an ini file and then add it to a csv file with headers. I have asked this question before but went a different route with the parse. I multiple section like the below that i need to parse and put together in a csv file. Header1 Header2 Header3 something1 something2 something3 so...
by sekou2331
Thu Nov 30, 2017 10:47 am
Forum: Windows PowerShell
Topic: not using NT\Authority
Replies: 4
Views: 808

Re: not using NT\Authority

So after researching I tried the below and it seems to work. So my question is what is the best method? $password = 'Password' | ConvertTo-SecureString -asPlainText -Force $username = "Domain\user" $credential = New-Object System.Management.Automation.PSCredential($username,$password) (Get-WMIObject...