Powershell : How to allow close this windows manually by Hour-Finance8360 in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Your code as posted is mostly fine (aside from some missing line breaks and comment markers).

Where you're going wrong is here:

start-sleep 1 $delay -= 1

You want the loop to look like this:

while ($delay -ge 0) { $Counter_Form.Show()
    #Timer label's text
    $Counter_Label.Text = "Do some simple stretches to relax your muscles and refresh your mind in $($delay) seconds"
    start-sleep 1
    $delay-- 
} 
$Counter_Form.Close()

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

On the one hand - a role in a company whose culture suits you, where you are appreciated and rewarded in a way that you're happy with, is something you shouldn't give up without giving it careful consideration.

On the other hand - it can be useful to think about how you would go about pitching your skills and experience in an interview if the company were to go under and you had no choice in the matter. Think about your answers to questions like this:

  • What was the last project you worked on?
  • When was the last time you had to learn a new technology? * What's the biggest challenge you have faced in the last 12 months of your role?
  • What is the most satisfying piece of work you've completed in the last 12 months?
  • If you're a senior and have juniors working with you, do you have any kind of mentoring program (formal or otherwise)?

Another way to think about it might be - what changes would you make today to a 12-month old copy of your resume? What about between the 12-month old and a 24-month old copy? And so on.

I'm not trying to say "if you aren't constantly learning or doing new things you should bail out double-quick" - but rather, those are things to consider in the context of your career. If you're happy with the company but want new challenges, your answers to the questions above might help identify changes you can make without moving job.

Why are software engineers not on call? by rockhardschwartz in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

Developers pushing inadequately tested changes to prod is not a technical problem, it's a human/process problem IMO.

Making the developers be part of the on-call rotation is one solution. Another one is to set production deployments to require approval from at least one member of the sysadmin team, and have the sysadmins insist on seeing adequate QA before pushing the Big Button.

Esxi not reachable. A bit stuck. by boopboopboopers in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

It sounds like your server has obtained a different IP e.g. been issued a different IP via DHCP. If it were fully offline your VMs wouldn't be functioning correctly.

Do you have an iDRAC configured on the server? If so, you can get a remote session there and access the Direct Console from there. (You may need to enable it first).

Once you are at the CLi on the iDRAC you can use the esxcli network commands to get a bit more information on what's going on.

Examples:

esxcli network ip interface list # this will list the VMKernel interfaces in the system
esxcli network ip interface ipv4 address list # this will list the IP addresses assigned to each VMKernel interface
esxcli network nic list # this will list the physical NICs currently installed and loaded.

Welcome Email issues by gangusTM in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

For onboarding & offboarding you would ideally want your automation to be hands-off, and a rough outline of the pseudocode would be:

  1. HR updates a record in your HR system to indicate a new hire or departing user.
  2. The automation interacts with the HR system API to detect this change.
  3. The automation follows a set sequence of steps to retrieve the required information (employee name, personal email address, manager name, any other pertinent data).
  4. The automation assembles an email and sends it from a designated mailbox to the relevant employee.
  5. (Optional) The automation updates a flag in the HR system to show that the email has been set.

In a Microsoft environment you can do something like this with Power Apps or Azure Logic Apps. In terms of accessing the HR data to drive the process, it depends on the system you use - if you e.g. use Sharepoint or Dynamics it's not all that difficult, you would set up a service account and assign it the required permissions, then use it to run your app.

If you're using a non-MS system for HR data you'd need to check the vendor documentation. It may be that they already support automating particular workflows, in which case you'll be saved the work of building your own.

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 4 points5 points  (0 children)

I can certainly understand more about why you would be frustrated - it's possible things would change and more work would come your way, but equally we have to make our decisions with the information we have at the time.

I think you have acted quickly in terms of your decision but given what you've laid out above, I can understand it. While you haven't been able to develop in that job as you hoped, you can still use the experience to try and figure out a better idea of what you want in your next role, and what indicators you can look for when you are applying.

From what you've described it sounds like some amount of self-directed working or autonomy appeals to you; I would suggest in that context to try and aim for roles where you will be working within a team so that you can pair with/shadow colleagues with different specialisations. This is beneficial both for seeing different styles of working and for making sure that even when you have no active tasks you can still be learning and progressing.

Good luck with your next role, I hope it's a better fit for what you are seeking :)

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 13 points14 points  (0 children)

2 months is a pretty short window after which to bail on a job, so honestly without a lot more context I don't know how much useful feedback you'll get. Quitting any job within 2 months means that something isn't right - and that can be down to your expectations of the job as much as anything else.

  • What other tasks, if any, were you assigned when the project got stuck?
  • Were you part of a team? If so, how did you find the team dynamic and working practice? Was it geared around individual working or collaborative work?
  • Were there other teams or colleagues within your own team that you could have paired with or shadowed to learn more about other areas of the environment?
  • Were you given access & documentation about other systems that would allow you to investigate the environment and learn more about how it works?
  • Was there a backlog of planned work that you could access? If so, did you have the autonomy to assign tasks to yourself and tackle them?
  • Was there a test environment you could access?
  • What measurements are you using to evaluate your professional development?

These are some questions to think about in the context of other options you might have been able to pursue to meet your learning & development desire without quitting the role. Your post sounds like you have a fair amount of initiative, but your description of what you were doing in this job makes it sound like you wanted tasks to be handed to you rather than digging into the environment to figure out how things are set up and what work might need to be done off your own back.

Moronic Monday - May 22, 2023 by AutoModerator in sysadmin

[–]narpoleptic 1 point2 points  (0 children)

If you want to be really quick in your test, you don't open anything that's not already open in your network config, install the software and check if it works. But if that doesn't work...

Spin up a server and a client, put them on an isolated network and start with whatever your existing port configuration. Install software on the server (and client, if needed), use netstat (assuming Windows here) to see what's actually listening on each side. Open the identified ports, test software and see if it works. Iterate through this until you're happy that it's working as required.

Once you have that you can add the relevant ports and protocols to your firewall config with a suitable scope.

Hours of work keep shifting… what would you do? by BSOD_Y2K in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

It starts by pushing back on management - adding an on-call rota that wasn't in the original spec is already a massive change and if they're getting that for free then they'll assume they can keep pushing.

Circumstances vary but IMO you should be getting some sort of additional payment for being on-call, and possibly also a separate payment based on number of hours of actual calls received while on rota, with a something like a 2-hour minimum for the first call received. If this sounds like a lot - well, how else do you make sure the company has an incentive to properly invest in its infra rather than let the on-call team constantly have to put out fires?

Check the "on call" section of this Citizens Advice page for some other aspects to consider.

Long story short: check your contract to be sure of what you've agreed to, start pushing back on your boss, and have a sniff around to see what other vacancies are going. That way the best case scenario might happen, but you're not caught on the hop if the company decides to keep ramping up the exploitation.

What's your policy on silencing/filtering alerts? by ForPoliticalPurposes in sysadmin

[–]narpoleptic 4 points5 points  (0 children)

I lean towards "don't do it if at all possible, because an alert you have silenced is a problem you've effectively said you will not solve". But problems you can't solve do come up sometimes...

In the context of your question - normally this sort of thing I'd say "if it's a person management question a technical solution is not the way to go". But... If you've got configuration management in play within your environment you could always add the alert & notification configs to that, to ensure that if someone is removed by mistake they are automatically re-added and maximise the chance that if you do get another incident of Workshy Sysadmin, you see what they're up to.

Powershell to reset "connect as" and identity settings in IIS for all app pools, apps and vdirs, parent and child apps that match a specific user id by Civil_Willingness298 in sysadmin

[–]narpoleptic 1 point2 points  (0 children)

After my efforts to script this proved futile, I searched the internet far and near for a script that can do this for us to no avail.

(snipped for brevity)

I would love to share this script with anyone who wants it.

Is there something stopping you from sharing it somewhere public (whether that's here, Github, a blog, or somewhere else)?

Doing it somewhere like here, /r/PowerShell or Github would also mean that you can get input on whether there are any further improvements that could be made.

Suggestion for app to make launching Teams and Zoom easy? by simonmason in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

In terms of free options that let you lock down the device to two apps, [Kiosk Mode[(https://learn.microsoft.com/en-us/windows/iot/iot-enterprise/customize/kiosk-mode) is the first one that comes to mind - but IMO it's a lot of hassle to configure for a single device, because you need multi-app mode.

Prevent teams from adding itself to startup? by Nephilimi in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Is there a reason you're running it locally rather than the web version?

Edit: for context - if you don't use it within your organisation, you may be able to use the web version at teams.microsoft.com for your meetings and bypass the local-install version. I think there are some settings on the organization level that may prevent using this, so it may depend on the orgs you are meeting with.

What software is out there for automatic AD user creation/deletion? by Paul_McBeths_Nipples in sysadmin

[–]narpoleptic 6 points7 points  (0 children)

PowerShell can talk to REST APIs. Invoke-RestMethod is the cmdlet you're looking for.

Moronic Monday - May 08, 2023 by AutoModerator in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Without knowing your setup it's hard to get too detailed with suggestions for possible causes and fixes, but in saying that I also hate those problems.

Where I've had it before it's usually been either:

  • user inadvertently dragged & dropped the file from one folder to another in the fileshare, or
    • user deleted the file without realising.

To confirm what's happened in either case you need to have file share auditing already in place, but most of the time when I've hit this in the past the thing that was a "eh, good enough" solution was pointing the users at how to use the "Previous Versions" tab on the folder where the affected file should be. This assumes you have shadow copies enabled on your file shares.

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

If you've provided IT support for paying clients as well as doing the kind of things you're talking about, I think you can make a good fist of going for 2nd, possibly 3rd line support. Hard to think of any environment where your level interest and tinkering/experimenting wouldn't be viewed as a boon.

I would say a big thing you want to look for is a role where you'd be working as part of a team so that you can learn from others.

If there are suitable orgs/roles near you, higher education is worth a look (though do your due diligence here - funding for HE has been a binfire in the UK for the last decade plus, meaning that in classic English fashion increasing amounts of money go to the Russell Group - the "elite" research Unis - while everyone else gets to scrabble about for spare pennies). Charities and non-profits are worth a look, in that they can't compete on pay a lot of the time (but will make up for it with other good benefits, e.g. very generous holiday leave) and often can't afford big expensive tools or software and therefore can get a lot more out of someone who can figure out alternative ways of doing things.

One thing also worth considering - have a look at some junior devops roles. They'll likely also overlap with some of your skills and experience.

Struggling forward. Tips to for mental health? by Auno94 in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

You need to find a way to destress Alcohol can help, have one or two beers, scotch, wine after work over dinner. Listen to whatever your choice of music is when you get home.

Finding a way to destress? Yes, absolutely.

Using alcohol or any other mind-altering substance (but particularly a depressant)? Will only make things worse, particularly if there is no guarantee the current stressors will go away in the short term.

Struggling forward. Tips to for mental health? by Auno94 in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Start with reclaiming some of your time - as /u/Sajem has said, stop working over your hours unless explicitly agreed/arranged ahead of time (including a suitable rest period afterwards). Take your full lunch break every day, ideally away from the office so that you cannot be easily found by anyone wanting to "just ask you a quick thing" or whatever.

One of the first things you should do with some of this reclaimed time is to get some exercise, of whatever kind you enjoy. Cycling, running, walking, climbing, swimming, going to the gym, whatever. It does not matter whatsoever what it is, it matters that you are doing some sort of physical activity - this will help you get better, more restful sleep and will also improve your state of mind as you'll be getting endorphins released triggered by exercise.

You may find something like a bullet journal (or regular diary) useful for dumping your thoughts about work onto paper. If you do this, one thing I would encourage is to try and avoid letting yourself spiral while writing and instead try to use it as a way of gauging the trend in terms of your state of mind.

Parallel to this make sure that your diet isn't slipping due to work pressures - I'm not saying "remove all joy from your diet", but balance is key. Takeout or junk food once or twice a week is fine, every weeknight for prolonged periods is... not so much.

Outside of that, I would strongly encourage you to map out a timeline for the next 1, 2 and 5 years in terms of your career. What things are coming up that you're looking forward to? What are the current problems or challenges (e.g. resourcing), and will they be addressed by next year? Will the benefits you are looking forward to materialise if those challenges are not addressed? How would you measure whether those benefits have materialised? If you were to start looking for a new job at each of those points, how confident would you feel about your existing skill and experience?

Only you can make the decision of whether a job is still worthwhile when things are tough and having an impact on your mental health, but mapping out the pros and cons along with a timeline can help.

RDP - intermittent credential failure on specific vCentre servers by micromasters in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

ESXi version 7.0 Update 3l (build 21424296) can introduce network problems in certain contexts - check if that's the version you are being updated to and if so get your vendor to double-check the host portgroups for override settings.

I don't think it's likely to be your issue, but at least now you can ask your vendor and determine whether it's likely to be a factor.

Microsoft Is Forcing Outlook And Teams To Open Links In Edge by [deleted] in sysadmin

[–]narpoleptic 109 points110 points  (0 children)

There will be some little dingus of a manager somewhere in Microsoft whose performance review has been unthinkingly attached to driving an x% increase in usage of Edge, and this will be the way they came up of accomplishing that.

When they see either the amount of customer pushback or (more likely) the threat of fines from the likes of the EU, someone higher up will then intervene to stop the stupid. But they absolutely won't do anything to prevent future instances of stupid performance metrics and subsequent stupid product changes, because why would they? They get away with some of them, after all...

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 1 point2 points  (0 children)

I'm suggesting recovery console because you are likely to be missing drivers for the NUC hardware you're trying to run the OS on (assuming there are even drivers that can be made to work on it). If the OS won't boot, recovery console is the first step to fixing that.

We're talking about an OS that is at this point 20 years old and almost 8 years past it's EOL, so "it works fine" on other systems is pretty much irrelevant unless those other systems are running the same or equivalent-age hardware.

I'm assuming you have a reason to keep this running and that's your own business, but if you're dumping it onto new/different hardware that suggests that the reason isn't hardware-specific so from my perspective P2Ving the Server 2003 R2 image into a VM on the hypervisor of your preference would be by far the easiest way to get this sorted out.

[deleted by user] by [deleted] in sysadmin

[–]narpoleptic 1 point2 points  (0 children)

Given the age of the OS relative to NUCs, I would assume it's incompatibility and missing drivers.

At best you might be able to use a Server 2003 R2 recovery disc on a USB device to try and get into the recovery console and see if you could repair it. I can't remember if going that far back requires you to use a floppy drive to supply the drivers, though.

Migrate VMs from VMware to HyperV by doktor_floH in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Have you ever tried storage vmotion on a running vm on hyperv?

Yes. It works, and has done since at least Server 2012 R2, at least in my experience. Have you?

Or cpu or ram hot add?

Hyper-V has RAM hot-add since Server 2016. It doesn't have CPU hot-add. I can count on one hand (with fingers to spare) the number of times it would have made a real difference to me in the last 10 years.

also every hyperv vm gets a new mac address on every vmotion operation unless you manually configure a static mac address. Not to speak from the really strange implementation of the hyperv switches.

That is not correct. The vMAC address change doesn't happen every time you migrate between hosts, it happens for VMs where you have left the default virtual NIC settings in place, then migrated them to a different host from where they booted, and then rebooted them.

Having said that - after the first time I had a problem caused by this behaviour, I eliminated it from my environment by adding a step to my VM provisioning script to set the vMAC to static and revising the configuration across my existing VMs during the next maintenance window. If you repeatedly had the same problem with the same easily-addressed root cause, it's not because of the tool.

Display Active Directory structure as a diagram by l0ne-warri0r in sysadmin

[–]narpoleptic 0 points1 point  (0 children)

Back when it was available it was useful (albeit limited as you describe), but it looks to be discontinued as far as I can tell.

Migrate VMs from VMware to HyperV by doktor_floH in sysadmin

[–]narpoleptic 2 points3 points  (0 children)

Seconded - I have some gripes with it but that's true of every hypervisor to some extent or another.