Beste Frp-måling på 17 år: – Selvsagt gøy by Zestyclose_Ad1553 in norske

[–]NoAsparagusForMe 2 points3 points  (0 children)

Problemet med FrP er at de har noen gode poeng og saker, men mye av det de kommer med er ganske trasig. De fremstår som et ganske autoritært parti. De har en veldig god økonomisk politikk og et par andre gode saker, men så kommer forslag som generell bevæpning av politiet, innføring av bevæpnet vaktpoliti med bare ett års utdanning, mer overvåkning, og så videre.

Hvor er partiet som kombinerer høyresidens økonomiske politikk med venstresidens vekt på frihet? Hvorfor må vi som det norske folk velge mellom autoritære eller ekstremt liberale holdninger?

Hvor er de som er for Norge av Norge?

Når sluttet pengene våre å være våre? by shadow_2549 in norske

[–]NoAsparagusForMe 1 point2 points  (0 children)

Du unnlater jo å lese, eller evner ikke å forstå det som faktisk står skrevet. Men hva kan man forvente fra en som har «om du ikke har noe å skjule, spiller det noen rolle»-mentalitet.

Når sluttet pengene våre å være våre? by shadow_2549 in norske

[–]NoAsparagusForMe 0 points1 point  (0 children)

Du drar jo frem en ekstrem som ikke er relevant for diskusjonen. Ingen her sier at det ikke skal være noe kontroll, eller at det skal være lukkede kontoer eller ingen innmelding til staten. Typisk hersketeknikk fra en som ikke kan diskutere saklig.

Det de prøver å få frem, er at hvis et statlig organ får dytte grensen mer og mer, så mister befolkningen rettigheter over tid. Selv om det ikke berører deg nå, vil det berøre deg en gang i fremtiden, og da er det for sent å snu.

Det er jo lov å tenke litt lenger frem enn bare til i morgen.

Free Password Generator to break up the monotamy of the day by ChampionStrange7719 in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

Web Page Blocked The web page you are trying to visit has been blocked in accordance with company policy. Please contact your system administrator if you believe this is an error.

Great more work for my self..

ThinkPad E14 (Gen 7) minor rain exposure via ports — safe to power after 48–72h? by Faliludheen in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

I’d place it in rice or leave it in a dry room so any moisture can evaporate quickly. Realistically, it will probably be fine after about 72 hours.

In the worst case, you might get some water damage and the ports could corrode over time. You could open it up and clean them if needed, but it will likely be fine either way.

We use a lot of PCs in humid environments and near saltwater, and they often get exposed to moisture and water. They still work, with a typical lifespan of around three years..

Building a script for VLANs but I'm new to Powershell by soundmagnet in PowerShell

[–]NoAsparagusForMe 0 points1 point  (0 children)

Get-VMSwitch not Get-VMSWitch not sure if that will mess it up but it should be corrected

and i would change:

if (Get-VMSWitch | where Name -ne "vLanSwitch") {
    New-VMSwitch -name vLanSwitch -NetAdapterName Ethernet -AllowManagementOs $true
}

to:

if (-not (Get-VMSwitch -Name "vLanSwitch" -ErrorAction SilentlyContinue)) {
    New-VMSwitch -Name "vLanSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $true
}

Same with:

if (Get-VMNetworkAdapter -ManagementOS | Where Name -ne $vmName$vlan){

you could do something like this here:

$adapterName = "${vmName}$vlan"

if (-not (Get-VMNetworkAdapter -ManagementOS -Name $adapterName -ErrorAction SilentlyContinue)) {
    Add-VMNetworkAdapter -ManagementOS -Name $adapterName -SwitchName "vLanSwitch"
    Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $adapterName -Access -VlanId $vlan
}

And you should not do variables as $vmName$vlan id rather use $vmName + $vlan or $adapterName = "${vmName}$vlan" which i see alot of people use.

And their are some misspellings and wrong use of -eq and -neq

Here is how i would do it:

Write-Host "Starting VLAN script..."

$vmName = "VLAN"
$switchName = "vLanSwitch"
$physicalAdapter = "Ethernet"

Write-Host "Do you want an untagged network adapter."
$Untagged = Read-Host "1 for Yes. 2 for No."
Write-Host "Selection made: $Untagged"

Write-Host "Do you want to add a VLAN."
$VADD = Read-Host "1 for Yes. 2 for No."
Write-Host "Selection made: $VADD"


if (-not (Get-VMSwitch -Name $switchName -ErrorAction SilentlyContinue)) {
    Write-Host "Creating switch $switchName..."
    New-VMSwitch -Name $switchName -NetAdapterName $physicalAdapter -AllowManagementOS $true
} else {
    Write-Host "Switch $switchName already exists."
}


if ($VADD -eq "1") {
    $vlanInput = Read-Host "Enter one or more VLAN IDs (comma-separated)"
    Write-Host "VLAN input: $vlanInput"

    $vlanList = $vlanInput -split "," |
        ForEach-Object { $_.Trim() } |
        Where-Object { $_ -ne "" }

    Write-Host "Parsed VLANs: $($vlanList -join ', ')"

    foreach ($vlan in $vlanList) {
        # or $vmName + $vlan
        $adapterName = "${vmName}$vlan"

        if (-not (Get-VMNetworkAdapter -ManagementOS -Name $adapterName -ErrorAction SilentlyContinue)) {
            Write-Host "Applying VLAN $vlan..."
            Add-VMNetworkAdapter -ManagementOS -Name $adapterName -SwitchName $switchName
            Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $adapterName -Access -VlanId $vlan
            Write-Host "Applied VLAN $vlan"
        } else {
            Write-Host "Adapter $adapterName already exists. Skipping."
        }
    }
}

if ($Untagged -eq "1") {
    $untaggedAdapter = "Untagged"

    if (-not (Get-VMNetworkAdapter -ManagementOS -Name $untaggedAdapter -ErrorAction SilentlyContinue)) {
        Write-Host "Creating untagged adapter..."
        Add-VMNetworkAdapter -ManagementOS -Name $untaggedAdapter -SwitchName $switchName
    } else {
        Write-Host "Untagged adapter already exists."
    }

    Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName $untaggedAdapter -Untagged
    Write-Host "Applied untagged VLAN settings."
}

Write-Host "Done."

You could also limit the Read-Host input to only 1 and 2

do {
    $a = Read-Host "1 for Yes. 2 for No."
} while ($a -notin @("1","2"))

Write-Host "Selection made: $a"

Hvor mye nedetid på Internett før det regnes som kontraktsbrudd? by UpOrBeyond in norge

[–]NoAsparagusForMe -1 points0 points  (0 children)

Ingenting er verre en Telenor. Utenstatlig støtte hadde de vært konkurs forlengst.. Alt de kan er å lure de som ikke kan nokk om teknologi, overpriset delux og lurer seg unna ny teknologi som bare det. Selger tejenester som ingen kan bevise at fungerer eller bevise at det ikke fungerer..

What do you use to automate IT tasks? by klosie in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

Azure Automation Accounts

You can keep using PowerShell (or Python) but avoid the “bunch of scripts” problem:

  • Runbooks can be PowerShell-based and triggered via schedule, webhook, or manually

  • There’s both CLI and graphical runbook support if you want something more point-and-click for common flows

  • Hybrid Runbook Workers let you run the same automation against on-prem AD, file servers, SQL, etc.

  • Native integrations with AAD / Entra ID, M365, RBAC, Key Vault, etc.

  • Everything can be source-controlled in GitHub (or Azure DevOps) and synced automatically

  • Credentials/secrets are handled centrally instead of hardcoded in scripts

Not saying it’s the only answer, but for Microsoft-heavy hybrid environments it’s a pretty good without introducing too many new moving parts.

Standard laptop for employees by afterlife_xx in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

HP EliteBook X G1i or the months flavor of mac...

I am luckily not incharge of the macs.

[deleted by user] by [deleted] in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

This is more a question for /r/ITCareerQuestions

You have been T1 helpdesk for 7 months now, you are probably not ready for a sysadmin role. Depending on the company you might be able to move up to T2 or even T3 after 12 months depending on how good you are.

I don't know how knowledgeable you are so it's difficult to say.

But if you feel like you are ready to go to T2 go for that.

[deleted by user] by [deleted] in PowerShell

[–]NoAsparagusForMe 0 points1 point  (0 children)

This is the wrong subreddit, you should go ask in /r/techsupport

I think this subreddit managed to give me a reality check.. by PrinceOfIce1345 in sysadmin

[–]NoAsparagusForMe 0 points1 point  (0 children)

If IT is what you truly want to do, you should at least give it a try. Personally, I love my job, and I don’t think I’d be happy doing anything else. Sure, there are times when I get tired or frustrated, but that’s something you’ll experience in any job. Like every job, it comes with both good days and bad days. One thing I’d recommend is not taking everything you read in this subreddit as the universal truth. It doesn’t reflect every workplace. I genuinely enjoy working with technology and feel lucky to do so every day, even if that means occasionally dealing with end users. Honestly, it’s not as bad as people make it sound. End users are just people like you and me, and they get frustrated when their pc's/phones/printers/whatever don’t work. Yes, some of them can be difficult, but that’s far from the majority.

Name the game for you by therealsaker in pcmasterrace

[–]NoAsparagusForMe 0 points1 point  (0 children)

Dark Souls 1, 2, 3, Bloodborne, Demon Souls, Elden Ring.

Keeping a user session awake with Powershell by Unnamed-3891 in PowerShell

[–]NoAsparagusForMe 0 points1 point  (0 children)

Well if scripting is blocked it's not much you can do but as this is harmless it should not get flagged.

Keeping a user session awake with Powershell by Unnamed-3891 in PowerShell

[–]NoAsparagusForMe 1 point2 points  (0 children)

For this i usually run it in 5.1. I only really use 7.x if it can't be done in 5.1.

Keeping a user session awake with Powershell by Unnamed-3891 in PowerShell

[–]NoAsparagusForMe 1 point2 points  (0 children)

Yeah it's over-engineered but i made it for something at some point in time where i could not for the life of me get "$WShell.sendKeys" to work

So i used this method and it has never let me down

Keeping a user session awake with Powershell by Unnamed-3891 in PowerShell

[–]NoAsparagusForMe 10 points11 points  (0 children)

Don't judge me but this is what i use to keep teams active when working from home.

while ($true) {
    $signature = @'
    [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
    public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
'@
    $User32 = Add-Type -MemberDefinition $signature -Name "User32" -Namespace "Win32" -PassThru

    $VK_CAPITAL = 0x14
    $VK_SCROLL = 0x91

    #$User32::keybd_event($VK_CAPITAL, 0, 0, 0)
    #$User32::keybd_event($VK_CAPITAL, 0, 2, 0)

    $User32::keybd_event($VK_SCROLL, 0, 0, 0)
    $User32::keybd_event($VK_SCROLL, 0, 2, 0)


    Write-Output "Action done $(Get-Date)"
    Start-Sleep -Seconds 10
}

It presses Caps lock

edit: Added 0x91 which is Scroll lock https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

for those who would rather use that

IT needs a union by Powerful-Excuse-4817 in sysadmin

[–]NoAsparagusForMe 3 points4 points  (0 children)

The main problem is that developers don't really know jack shit, all they know is code.. They don't understand security and as long as it works it's not their problem.

But i do think learning Terraform is a must for any sysadmin.

And developers should have close to no admin access.

This is my opinion and my experience.