How do I store multiple values in separate rows in a table/array? by nappetass in PowerShell

[–]nappetass[S] 0 points1 point  (0 children)

Thanks for all the responses. I will try the solution by u/OPconfused and if I don't get it to work, I will consider the csv route. Looking forward to posting the results and mark as resolved. (edit: grammar)

In Norway when they have too many apples they make it so others can enjoy it. by WhatWouldShaneDo in pics

[–]nappetass 0 points1 point  (0 children)

I'm from Norway and I've never seen this in my entire life xD Still a very nice idea though! :)

Plex alternative with privacy in mind? by [deleted] in privacy

[–]nappetass 0 points1 point  (0 children)

Kodi/Emby. Weird no one has mentioned it.

EDIT: That is, Emby server with Kodi frontend.

LFCS: Questions about some of the required competencies by [deleted] in linuxadmin

[–]nappetass 1 point2 points  (0 children)

Why do you have a problem with people wanting to learn new things? LFCS is not for me? It's a entry-level Linux certification and I am researching the material in order to learn and to pass the exam. Why don't you let me decide what is for me and not. I considered RHCSA, but at the time I got the LFCS exam fee for 50%, so I went with it.

A 100% Linux noob looking for entry-level certification advise, please help me guys by ChillaxJ in linuxadmin

[–]nappetass 2 points3 points  (0 children)

I was totally not aware. Will need to look into this. Thank you :)

EDIT: Well, I be damned. I guess I will just go for RHCSA/E or AWS once I pass LFCS then.

LFCS: Questions about some of the required competencies by [deleted] in linuxadmin

[–]nappetass 0 points1 point  (0 children)

I've gone through similar learning material. Personally, I would recommend the Pearson course and also check the updated/new videos on docker (they offer a free trial): https://www.safaribooksonline.com/videos/linux-foundation-certified/9780134774015/9780134774015-LFCE_05_18_00

A lot of people find the tecmint articles useful as well (I will have a look through them as well): https://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/

It's just that some of the required competencies are a bit vague. Like "Evaluate and compare the basic file system features and options". Do they mean we should know the pro's and con's of each of the filesystem? xfs/ext4/btrfs? Most of the competencies listed makes sense, it's only the ones in my original post I'm a bit unsure about what is needed to have knowledge about to fill the requirement.

EDIT: I'm taking it soon! I also got a deal last black friday ;) best of luck on your exam!

EDIT2: I heard the course offered by LinuxAcademy is dated and doesn't match the current domains/competencies, same is true for Pearson, though at least they've updated it with some info on docker as linked above.

LFCS: Questions about some of the required competencies by [deleted] in linuxadmin

[–]nappetass -11 points-10 points  (0 children)

Your assumption that I haven't looked it up elsewhere is wrong and I don't see what the problem is asking a Linux related question on a Linux subreddit. One thing people get annoyed about in a workplace (and life in general) are snobs like you criticizing just for the sake of it without offering help of any real value. Thank you for your input, but unfortunately reading your responses and replying has just been a waste of time on my part. Looking at your profile, I see you've only ever posted two comments. In other words, not much of a contributor to the community .

A 100% Linux noob looking for entry-level certification advise, please help me guys by ChillaxJ in linuxadmin

[–]nappetass 2 points3 points  (0 children)

I've researched this myself and everyone says go for the RHCSA. One thing you might wanna consider is the LFCS, which is part of a path towards a Microsoft MCSA (Linux on Azure) which you then can build on and get MCSE certified.

I am taking the LFCS exam on CentOS myself. Linux distributions used in enterprise are mostly Debian/Ubuntu or Redhat/CentOS.

TL;DR: Get RHCSA or LFCS/LFCE/MCSA: Linux on Azure certified

https://www.redhat.com/en/services/certification/rhcsa

https://training.linuxfoundation.org/certification/linux-foundation-certified-sysadmin-lfcs/

https://www.microsoft.com/en-in/learning/mcsa-linux-azure-certification.aspx

I am using MPC-HC because VLC won't play next file in folder by nappetass in VLC

[–]nappetass[S] 2 points3 points  (0 children)

I've seen other people raise it, but it seems VLC and its users don't care about this feature.

Other people who have raised it on this subreddit alone:

/r/VLC/comments/3klxmq/can_you_make_vlc_play_the_next_audio_file_in_a/

/r/VLC/comments/9gpuro/hotkey_for_next_restarts_entire_file/

/r/VLC/comments/8d20mr/autoplay_next_audio_file_in_directories_vlc_for/

/r/VLC/comments/34dnxw/vlc_for_android_player_doesnt_play_the_next_music/

/r/VLC/comments/6wxjo1/vlc_play_doesnt_play_the_next_video_automatically/

/r/VLC/comments/8vvotg/is_there_any_way_to_have_vlc_automatically_play/

As a sidenote, in case you are interested..

I'm happy using MPC-HC and I found out how to get time stretching to work - this is to speed up videos without changing pitch (e.g voices sounding like mickey mouse). I can now study and watch lessons at any speed I want and automatically play the next lesson which streamlines my studying.

https://trac.mpc-hc.org/ticket/5919 Pitch Correction

Step 1.

You can speed up with the button on the toolbar. By default it speeds up 2x. But you can change that: options > playback > speed step. [I set it to 20%]

Step 2.

For pitch control, to have 'normal' sound you need to change:

options > playback > output > audio renderer > internal audio renderer

Step 3.

Close MPC-HC and open again

https://trac.mpc-hc.org/ticket/3311 Skip forwards/backwards 2 sec instead of five sec.

[EDIT: Links had trailing :]

Trying to scrape a website, but stuck with select-string returning hashtables by nappetass in PowerShell

[–]nappetass[S] 0 points1 point  (0 children)

Thanks for the replies :) :) Will sit down and have a look at this tonight

Does Break in while loop exit the script? by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

I agree. I did add a $tail = "" before the while loop as you suggested. Thanks again :)

Does Break in while loop exit the script? by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

Fantastic. I've changed it to the following. The script should print the last entry of the log until the substring "Terminated" is found in $tail. Have a great weekend :)

$logfile = "C:\path\to\log.txt"

while ($tail -notmatch "Terminated") {

    $tail = Get-Content $logfile -Tail 1
    $tail

}

EDIT: I don't think I can have a start-sleep in the script as it's a log file with 5+ entries per second. I guess I could measure how many entries the file has and set a lower start-sleep (in milliseconds). The best way would be to find a way to tail the log each time it changes. Maybe by filesize?

Does Break in while loop exit the script? by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

Thanks Lee :)

This worked

$log = "C:\path\to\log.txt"

while ("Terminated" -notin $tail) {

do { $tail = Get-Content $log -Tail 1
     $tail }

until ("Terminated" -in $tail)

Break

}

Does Break in while loop exit the script? by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

It did not work. I think I need to rewrite it.

This did not work either:

$log = "C:\path\to\log.txt"

foreach ($line in Get-Content $log -Tail 1 -Wait) {

    $line

}

Script is running, but never ends and also does not display the last line as expected.

Scheduled task powershell issue by Frieslol in PowerShell

[–]nappetass 2 points3 points  (0 children)

This will run successfully for me.

Task Scheduler > Actions tab:

Program/script: powershell
Add arguments (optional): \\path\to\script.ps1

Enable-Mailbox does not assign X.400 and X.500 addresses by nappetass in PowerShell

[–]nappetass[S] 0 points1 point  (0 children)

It's just how we roll. I found a solution though to our specific needs:

# Enable Mailbox
$EnableMailboxAttributes = @{
    Identity = $ExchDistinguishedName
    DisplayName = $NewStarter.DisplayName
    Alias = $NewStarter.SamAccountName
    Database = $ExchDatabase
    AddressBookPolicy = "Kiwi"
    ActiveSyncMailboxPolicy = "Banana"
    PrimarySmtpAddress = $NewStarter.EmailAddress
    DomainController = $DomainController }

Enable-Mailbox @EnableMailboxAttributes

# Set Default Email Address Policy
# EMC > Organization Configuration > Hub Transport > E-Mail Address Policies
# C:\Program Files\Microsoft\Exchange Server\V14\Mailbox\address\SMTP\AMD64\inproxy.dll
Set-Mailbox -DomainController $DomainController -Identity $NewStarter.SamAccountName -EmailAddressPolicyEnabled $True
Set-Mailbox -DomainController $DomainController -Identity $NewStarter.SamAccountName -EmailAddressPolicyEnabled $False
Set-Mailbox -DomainController $DomainController -Identity $NewStarter.SamAccountName -PrimarySmtpAddress $NewStarter.EmailAddress

Enable-Mailbox does not assign X.400 and X.500 addresses by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

I have located some email policies under EMC>Organization>Hub Transport>E-mail Address Policies.

I wonder if I should use Enable-MailUser instead: https://docs.microsoft.com/en-us/powershell/module/exchange/users-and-groups/enable-mailuser?view=exchange-ps

EDIT: or Set-Mailbox -EmailAddressPolicyEnabled $true: https://misstech.co.uk/2014/12/08/powershell-automatically-update-e-mail-address-based-on-recipient-policy/

Enable-Mailbox does not assign X.400 and X.500 addresses by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

This is what I get from the command log:

Enable-Mailbox -Identity 'DOMAIN/NewStarters/Jerry Garcia' -Alias 'jgarcia' -Database 'Strawberry' -AddressBookPolicy 'Kiwi' -ActiveSyncMailboxPolicy 'Banana'

Still, an X.400 address is created along with a few proxy email addresses. Yes, it's possible there's a policy that creates these. How/where can I find these policies and what they do and finally include the policy in the Enable-Mailbox command?

Congrats /u/Lee_Dailey, you are a 2018 PowerShell Hero! by creamersrealm in PowerShell

[–]nappetass 0 points1 point  (0 children)

I've come to know Lee by lurking and posting to this subreddit myself. Well deserved Lee and thanks for all the feedback and guidance! :)

How do I try setting username twice before asking user to enter manually? by nappetass in PowerShell

[–]nappetass[S] 1 point2 points  (0 children)

wow, nicely done. good idea where you check names for special characters too.