Tuesday, December 3, 2024

Diablo 4 Hardcore Tips

Here’s a guide I’ve put together with my thoughts on hardcore progression in Diablo 4. I discovered the joy of hardcore probably 12 months ago and have written about it before. I now have more experience under my belt and want to share what I’ve learned. One of the most notable things I’ve learned is that it’s kinda hard to find D4 Hardcore content. So this is my step to solving that problem.

The guide is split into topics that start with the broadest possible thinking then get more and more detailed and specific. It assumes that you know the game well and have experience of the endgame in softcore mode.

 

Exposure:

In hardcore mode, you always run the risk of dying and losing all your progress. At any given time you run the risk of fully wiping out and having to start from scratch. Which, if it’s your fault, is all fair and part of the game. You just need the lesson to make fewer dumb mistakes. However, this is an online game that you are probably running on windows. Once you’ve got your head around the hardcore game play, technical issues are the far more likely cause of death.

To manage this, we want to think about the duration of a given activity. At any given point your internet could drop, or the client could crash or windows BSODs. Once you log back in you see the character has died. That’s a seriously unfun way to lose a HC character! The idea then, is to minimise the time spend doing anything and do activities that are short and sharp. You want mobs to die in one or two shots and ideally, the bosses are dead in under 5 seconds.

This way you are spending as little time as possible exposed to the risks of technical issues. I refer to this idea as reducing “exposure”.

 

Leveling:

The trick here is Level smooth. Slow is smooth and smooth is fast. Don’t examine every item as a possible upgrade, only swap out gear between long sessions of leveling fill a stash tab with interesting items till you hit 20 then spend some time building a set for 20+ then do it again around 30, 40 and 50. Constantly stopping to fiddle with gear slows you down. Once you have a good set keep in the stash for the next generation.

Use potions and incense for XP bonuses, you know that though it’s the basics of leveling.

When you hit 40 that’s a good time to do the strongholds. They are great sources of XP and will see you through to 55-60 easily. Don’t do the ones with long cutscenes. You just want to smash them out as quick as possible.

Leveling will happen mostly in Helltides, get the embers, open chests, get the baleful hearts, kill the blood maiden, get the embers... A self-reinforcing loop. I have had many happy times holding back the hordes of hell in hardcore. It’s a good time!

Don’t forget the Ashes from the season journey! They’re a good boost to XP.

 

Early End Game:

Eventually you hit 60 then all sorts of things come online to increase your power.

  • Higher tier gear: Helltides are still good to run till you’ve got ancestral gear with mostly the stats you want. Helltides are a good source of Whisper Caches too, which is a sorta halfway decent way to target farm for the right upgrades.
  • Glyphs: Drop Everywhere (levelled in Pits)
  • Obducite for Master Working: Nightmare Dungeons, Infernal Hordes, Undercity (tribute of refinement)
  • Paragon Levels: Just XP from doing stuff (Pitt is fastest source of XP)
  • Gem Upgrades: Just play the game
  • Upgrade Legendary Aspects: Just play the game
  • Upgrade Tempering recipes: Just play the game
  • Killing Bosses for Mythics: Don’t try this as a fresh 60.

At this point the best way to scale up power is Glyphs and Obducite. What I do is build my confidence up, one level at a time, to a level 20 pit, to unlock Torment 1. Then I chain-run nightmare dungeons. If you want to make it more efficient, you can stack up the dungeons that are offering Grim Favors. You can do this by picking a zone (Nahantu) and spamming as many Sigils as you can at the occulist. Salvage the ones not in the zone we are not interested in (so only keep the green ones). Doing this you can pretty quickly build up a good collection of NMD Sigils and then when the dungeons refresh you are able to open a nightmare dungeon that also gives Grim Favors! More Whisper Caches!


So in those initial NMD runs you are earing: 
Obducite, collecting Glyphs (alas not leveling them), Paragon XP, Gear drops, gem fragments, tempering recipes, legendary aspect upgrades and Whisper Caches! Look at all the sources to improve you power all through one activity! The fresh 60 in torment 1 is the fastest you can build your power!

That’s what you want! Do the thing that stacks as may ways to build your power. It won’t be long till you are oneshotting bosses in T1 dungeons that’s the time to hit some of the bosses you’ll probalby have some have materials to summon them that’ll have dropped from your activities. Undercity is a good place to get some if you have the tributes, but really, you can just zone out in a Helltide for an hour or two and you’ll get plenty (mind your exposure though).

Keep an eye on the boss that is offering whispers to stack up that even more power progress.

Once you’ve got a few whisper caches (don’t open them) roll an alt and open on that one. This will become your extra life. Don’t salvage gear you are upgrading on your main this goes to your alt as hand me downs.

 

The Pit:

This is the grindy phase where you are probably at most risk if you are not careful. Keep doing the activity that gets you the most power sources we’ve described above but once you’ve got all your glyphs also integrate some pit runs to level them up.

Here’s how to safely progress the pit in hardcore. Once you’ve got all the glyphs that you want to level you are right to start this process. To pick the pit level you want to take the safe route and level up one rank at a time. You want to be finishing you run in under 3 minutes to reduce your exposure. One or two shotting the bosses. If you are starting to stress on the bosses take a break from pushing pits and farm Obducite till you’ve got a bit more power. Pit levels are important relative to your glyph levels. If your pit is 10+ levels above your Glyph level it’s 100% guaranteed to upgrade one level. This is great and easy to achieve. If you are completing pits 20+ levels over the glyphs it’ll give you 2 levels and 30+ gives three. (I think this bonus caps at 15 for the plus 3 and 40 for the plus 2) but it’s plenty of head room to get the glyphs to where they need to be quickly.

There are two important points to hit level 15 has a bit power bump and then level 46.

So my process goes like this. Check my glyphs (look at the second from the left) add 20 (10 if you are conservative) to that and that’s the pit level I want to target. So if my glyph is level 5 I want to run level 25 pits (15 if being safe) so it gains levels when I upgrade it. When opening the pit (particularly on a torment boundary) check Armor and resists to ensure they’re still capped. Then when finished upgrade all the glyphs I am using from right to left (the game sorts them in descending order so if you keep doing that it’ll evenly level your glyphs. You only need to do the highest pit level that is going to level your glyph. Anything else will be slower and thus unnecessary exposure.

 

Changing it up with Infernal Hordes:

So once you are sick of pits and NMDs, try infernal hordes. These take a long time to run so are the biggest exposure of all activities. But the Obducite makes them tempting. The trick with these is to always pick the Hellborne upgrades (if there are none pick, exhaulted hordes, then elites, then spires, then masses) the best ones to get are “Surging” that increases the number of mobs dropping aether as well as the amount of aether they drop, which scales nicely once you stack other upgrades that increase the drop rate. Always pick max Obducite in the reward chest. Everything else you can source elsewhere.

 

Torment Progression:

Knowing when you are safe to bump the difficulty can be hard.

Get a good stack of resist gear so you are always maxed.

Armor: 100

Resists: 70%

Each torment level drops resists by -25% and Armor by 250, so keep an eye on that as you push upward. Use Gems, Tempers and Masterworking rolls to get the numbers you need. It’s never worth the risk of going in without the best possible protection. Get to know the alchemist, particularly for his incenses song of the mountain (Armor) and soothing spices (resists) They can help fill a gap in gearing for a while.

Once resists and Armor are at the caps, you are 4/12 masterworked everything and level 15 on the glyphs it’s time to think about torment 2. Which you can inch your way up to. Work your way up to level 35 pits one level at a time which you’ll have done already if you’re following the glyph level + 20 rule and they’re at 15.

Then you do it all again in torment 2 till you hit 8/12 MW and level 30 glyphs. If that level 49 pit boss is going down quick, it’s time to work on T3.

Now don’t rush into T4! The Obducite drop rates are tempting but even if you are surviving ok. If it’s taking a long time to down mobs, you are increasing your exposure. It is ALWAYS better to grind in lower Torments than risk the increased exposure trying to get a bigger but slower pay off.

Get your stuff 12/12 MW in T3 use the NMD whisper stacking trick, so it feels like a good time investment, trick your monkey brain that’s trying to convince you to push into T4.


Andriel:

I avoid her in higher torments. The difficult to avoid mechanics, with the tormented debuff that punishes not being able to avoid mechanics, combined with her fights structure, means even if you one or two shot her you still have to do that totem phase at least once. These all add up to just too much exposure. To be safe I want to be killing bosses in a couple of seconds not toptoeing through bruning tulips! I don't think I am alone there either. There's always people in trade selling shackles and pin cushioned dolls so it seems like a fight that a lot of people chose to avoid. However, those summoning materials do stack up in your bags screaming "we're potential runes! Or better turn us into Mythics!" well that starts to get on my nerves.

Eventually I roll up an alt and kill her in T1 just to clear the bag space of her summoning mats, and slience those voices. It’s easy in T1 to one hit her, kill the totems and then smack her once more before that horrific Giant Flame Laser is summoned. It is a good source of runes and it’s always nice when she drops a mythic. The best builds to use here are minion based they will(might) split up and kill the totems quick and get back on her for the killing blow allowing you to keep an eye on that giant flame laser beam bullshit.

 

 

Alts:

Alts are your extra life. Invest in them as soon as you can. Once you have a satisfactory level of gear horde Whisper Caches to open on your Alts. Open 27 caches and your bam your Alt is 60! Which is a bit of grind, buuut, it only takes 14 to hit 50! Then with your hand-me down gear (and maybe a lucky mythic) It's only a few Strongholds and a helltide or two away from being a fresh 60. Just saying. It’s good to have a backup character for when disaster strikes.

My alt choices this season was easy, Spiritborn is so OP almost every alt was some variant of the jaguar hall / viscous shield bugged builds. Although it is fun having a minion build for Andarial T1, that does require a whole other gear set so only worth it if you can manage the stash space. Otherwise they should be the same class and build as your main (or at least have stats and tempers in common) so you can get the most out of your hand-me-down gear. 


Groups:

I don’t bother I always solo bosses and just lol at all the “400m for a Duriel carry” posts in trade. Like, why can’t people do this themselves? Also, I am on the AU servers and joining people in the US means my ping goes from 50 to 200 which massively increases my exposure. The downside is that I have no-one to brag to.

I am not saying don’t group, grouping can offer safety in numbers, faster clear times, reducing exposure and shared knowledge, which can be lifesaving in hardcore mode. I just don’t. So there.

 

Summary:

So that’s it! Limit your exposure. Level smooth and steady to 60, leveraging fast XP by completing Strongholds. Save your gear for the next generation. Stack as many power increasing activities as possible to progress through the torments. One pit level at a time bringing the glyphs up at the same rate. Start preparing the next generation by opening whisper caches on them and using hand me down gear.

I hope you get something out of this guide. Trying Hardcore is well worth it. If you can mitigate the risks of exposure to issues that’ll kill you. The rush of narrowly avoiding a death that would wipe days or weeks of effort is among the best available in gaming. My best highs have been with this mode (also my worst lows) and well, hopefully this guide makes the game mode seem more approachable.

Stay safe out there!

 

Friday, August 11, 2023

Rediscovering the Magic

I've completely fallen for a new game - Baldur's Gate 3.

I loved Larian Studios work on their game Divinity Original Sin 2, which was considered one of the best CRPGs ever made. Well, I can say with confidence that Baldur's Gate 3 goes even beyond that.

What makes Larian's games stand out is their unique approach to development. They publicly release the first act of their games in early access and take in feedback from players over the course of years. This feedback-driven process is a recipe for creating games that resonate deeply with their players.

While Baldur's Gate 3 is, of course, constrained by the inherent limitations of video gaming, the developers have done their utmost to encapsulate the unbridled chaos, creativity and horniness that can occur during a tabletop game.

There is a now famous demo Larian gave around the launch of the game. Where the parties vampire rogue has a intimate relations with a bear. But it's OK! The bear is actually a Druid using his wildshape form. For context in the lead up to a demo of the romance features they followed what the crowd wanted for each dailogue option and that's where they landed!

If that description doesn't pique your interest, then perhaps nothing will. But if it does, you're in for an incredible gaming experience.

Here are my tips for Min Maxing your own amusement. Well it's what worked for me anyway.

🌟 Shadowheart's Evolution: At first, I had Shadowheart, a Trickster Cleric, who, while handy for her healing abilities, didn't mesh at all with how I played, she seemed weak and was annoying. So, the game let me do somethign about it! I respecced her into a Shadow Monk and wow, what a transformation! Not only did this change make her an evasion tank dishing out a whopping 30 damage per round, but the Shadow Monk role also complements her backstory perfectly. She underwent this transofrmation after spending the night with my main character Karlach. They just talked ok! Stop being so quick to judge! I am not worried about this change at all as to me anyway, it makes sense in the narrative and the timing of her transformation makes total sense. Now if the monk class ever feels less impactful later on, or I feel like I a missing the heals, there's always the possibility of transitioning her into a Paladin, which would work just as well, character wise, narativly and mechanically. It's this level of adaptability and character evolution that makes the game truly shine for me.

🌟 Natural Camp Comfort: After battling through intense scenarios and facing countless foes, there's nothing like unwinding at the party camp. I decided to embrace a more natural approach, setting everyone's camp outfits to be completely without armor or clothing. It's become a quirky and lighthearted ritual. As we settle down each evening, we shed our battle gear and embrace a carefree moment of relaxation, enjoying each other's company as a tight-knit and unashamedly authentic family. Hey don't judge! It's a fun, humorous touch to our in-game dynamics. 

🌟 Karlach's Redemptive Rage: Initially, I was skeptical about playing as a tiefling, but Karlach's personality completely won me over. Her vibrant and positive voice emotes coupled with her barbarian strength create such a dynamic character. It's almost poetic — she's a tiefling escaped from avernus, literally a devil breaking free from hell's shackles, rampaging through the world with a fierce drive. But here's the twist: she's on a mission for good. After our successful rescue of the tieflings at the Druid's Grove, Karlach's fervor for justice and righteousness only amplified. She's fired up, ready to champion more noble causes, and every time she vows to uphold what's right, I can't help but beam with pride. The contrast of her heritage with her desire to do good creates a wonderfully rich character arc that's both entertaining and heartwarming.

🧙‍♂️ Gale, the Classic Wizard: I've embraced a traditional approach with Gale, modeling him after the wizards we've cherished since the days of the gold box games. I'm all about that min-max life for him; I've opted for the iconic spells that have graced many a spellbook: Level 1’s Magic Missile and Burning Hands, followed by Misty Step and Enlarge for Level 2, and who can resist the sheer power of Level 3’s Fireball and Haste? It's like rekindling an old love affair with the foundational D&D spell lists. The gratification when those level 3 spells come online at level 5? Pure, nostalgic gold. Now, I am curious about the 'Fly' spell — I'm curious to see how they've adapted this. The idea of soaring through a meticulously rendered 3D environment? I have no idea how they'd pull it off technically.

🎲 Reuniting with Old DnD Mates: One of the best aspects has been reaching out to my longtime DnD buddies for a joint session this weekend. There's an unmatched joy in adventuring alongside old comrades, and I'm buzzing with anticipation! Curious to see the characters they'll craft and the strategies they'll employ. Navigating the challenges of Baldur’s Gate 3 is bound to bring back so many memories and create countless new ones. The weekend can't come soon enough!

In essence, Baldur's Gate 3 isn't just another game; it's a heartfelt ode to every tabletop session, every character we've ever created, and every narrative we've woven over dice rolls and character sheets. It's a bridge between cherished memories and the endless possibilities of the digital frontier. To the team at Larian Studios: thank you for rekindling that old magic and letting us dive into a world where every choice matters, every character evolves, and every session brings a new story to tell. Here's to many more adventures, side-quests, and late-night gaming sessions.

See you in the Baldurs Gate! 🎲🔮🗡️


Tuesday, July 11, 2023

A Guide to becoming Hardcore

 



Yes I want to discuss further my passion for Diablo 4 with anyone who will listen - This is a game that has ascended to the peak of my gaming experiences. There's this intoxicating sense of impending danger lurking around each beautifully realized corner of this stunning artistic masterpiece. I often find myself pausing, entranced by the minutiae of the world – the torchlight reflecting from pool of blood splattered on a dungeon floor. A poetic illustration of the light triumphing over darkness? Or just really high quality horror and gore? It's a game that can at times be transcendently terrifying. 

There's nothing quite like the gut-wrenching dread when your health plummets, or the triumphant relief as you decimate the monstrous horde that almost laid you low. This ongoing struggle against an ever-looming demise is what makes Hardcore mode of Diablo 4 incredibly enticing. But you know this from my last post

As the inaugural season of Diablo 4 kicks off on the 20th of July, I plan to roll out a Hardcore character. For those of you who are daring enough to tread the same path, I'd like to offer some advice. 

1.      First and foremost, understand that death is inevitable in Hardcore mode. The world is teeming with nightmarish creatures, it is a literal battleground where Angels and Demons are locked in the eternal conflict. You are choosing to be a hero in that world. Good luck Bucko. The odds are stacked against you, but how you manage these imminent deaths will dictate your success in this game mode.

2.     For your first character start on World Tier 1. This is about setting up for the future. Take it easy to start with while you unlock all the powers that’ll make the higher tiers safer.

3.      In Hardcore, it's not about raising a single, unstoppable character, to godhood. But rather establishing a robust legacy. Even when your character perishes, they leave behind infrastructure for their successors to build upon. Therefore, the primary focus should be on building this legacy - accumulating gear, creating sets, and unlocking account wide bonuses.

4.       A viable strategy could involve having sets of gear for every ten levels or so. This way, you're always ready to bounce back after a death. Gear is the most important aspect of character power in D4. The world scales to your level so the stats on your gear is the most important differentiator of power.  Here is my rough plan of character level to item power

Level 01-10 Item Power 001-149 World Tier 1

Level 11-20 Item Power 150-339 World Tier 1

Level 21-40 Item Power 340-459 World Tier 1

Level 41-60 Item Power 460-624 World Tier 2

Level 61-80 Item Power 625-724 World Tier 3

Level 80+ Item Power 725+ World Tier 4

5.      Couple this gear plan with the Renown system - which lets you earn renown with the 5 zones in the game to unlock permanent account-wide bonuses There are 10 skill points to be had from renown they are worth securing early so new characters can be ready with the core of their build from level one.

6.      Legendary aspects are granted as rewards for completing dungeons. So they are a priority, so long as you are confident you can kill the boss at the end. Those fights can be tense. Be careful. Plan the aspects you want and weigh the risk against the reward. Again these unlocks are account wide so they are highly valuable to get early.

7.      Another consideration are the Alters of Lilith, which also provide permanent character power boosts. They too persist across characters, offering yet another leg up for your successors. Whether you choose to discover these through gameplay or follow a guide is a matter of personal preference. I followed a guide and now regret it. It’s probably more fun to discover them “in the wild”.

8.       Lastly, two items are crucial for Hardcore characters. First is the "Elixir of Death Avoidance" that grants you a second chance at life when you drop to zero health. The second, "The scroll of Escape," teleports you back to town when you're in peril. Both can save your life, but they are expensive to craft and hard to find so should be used judiciously. 

Why play a high-risk game that could end in a moment of less-than-perfect gameplay or a random disconnect? The answer lies in the thrill of survival, the joy of building a dynasty of heroes that stand against the forces of evil. Even if you die to a disconnect, if you’ve planned and prepared, you are setup for the next character to level up and fill the void left by their predecessor.

So, take the plunge into this heart-pounding journey and make the first season of Diablo 4 a memorable one! The risk is high, the journey is challenging, but the rewards? They're absolutely worth it. Happy hunting, fellow adventurers!


Thursday, June 29, 2023

Embracing the Thrill of Diablo 4's Hardcore Mode

I've embarked on an exhilarating journey, plunging into the depths of Diablo 4, discovering a thrilling facet of the game - Hardcore mode. In Hardcore, when death reaches out, it's not just a pause, it's the end. Contrasting this to the relative safety of Softcore mode, the difference is stark and deeply rewarding.

Hardcore gameplay intensifies the risk and heightens the rewards, dramatically altering the player's emotional landscape. It's a dance with peril, a battle for survival, where weeks of investment into your character culminate in high-stakes showdowns. Where the thrill of entering a fight, the panic of almost losing, and the euphoria of snatching victory from the jaws of defeat create an intoxicating gaming cocktail I hadn't tasted in a long time.

Exploring the Diablo universe from this new hardcore perspective, I found myself drawn to idea of the seasonal competitions. Playing it from a one-life-per-season perspective, one false step could rob you of the rest of that season's narrative. This presents a unique blend of thrill and dread.

I have always enjoyed the underlying narrative of Diablo universe. The ongoing battle between heaven and hell, demons and angels, this adds rich context to this struggle for survival.

Diablo 4 takes this narrative an interesting step further, introducing themes of totalitarianism - a church striving to exert control over the population to prevent demonic corruption. This adds a fascinating dynamic, where the supposed defenders of the light breed as much suffering as their demonic adversaries.

Forming a group in Hardcore mode adds another layer of intrigue. It's an exercise in social dynamics and group strategy, a shared experience of survival where camaraderie is paramount. It's important to remember that death, in this mode, is a personal consequence of individual choices. Thus, pointing fingers and laying blame has no place in the Hardcore realm.

The Diablo 4 is designed to allow players of varying levels to party up. This eliminates arbitrary level gaps and creates opportunities for dynamic gameplay between anyone of any level. Albeit with the strange irony that due this level scaling design leveling up can actually make you less potent if your gear has been neglected. DING! Wow! The whole world has levelled up with me and now I hit for LESS DAMAGE! ... Cool?

There's another consideration too. Technical issues that cause your death. Any kind of connectivity issue between you and Blizzards servers can kill your guy. I've been having periodic black outs (electrical not conciousness) and that makes me super reluctant to play my hardcore character. The veterans of the game assure me that if you play Hardcore long enough you'll eventually die to some bullshit.

Even then the way Hardcore is designed makes it an interesting planning-meta-game. There's a shared stash that persists between characters so as you upgrade your gear you put the old stuff in the stash for the next generation to use. There's also a system of unlockable powerups that persist across characters, that makes Hardcore time investment worthwhile, even if your guy dies to a badly timed lag spike. So, the looming sense of dread that your character is going to die is offset by the fact they can bequeath the fruits of their toil to the next generation of characters.

It's been a long time in gaming since I have felt the heart pumping adrenaline rush that hardcore gave me. It has awakened a fire in my gamer soul. A passion for in-game-achievement that has been absent for a long time.  

So, to those of you on the fence about Hardcore mode or Diablo 4 in general, I urge you to take the leap. Join our ranks and find your place in this captivating world. Experience the thrill, the fear, the satisfaction - it's the fantasy RPG experience you've been waiting for.

The Hardcore journey is demanding, but the rewards are plentiful. If you're ready for a true test of skill and resilience, Diablo 4's Hardcore mode awaits.

Until then, keep your wits about you, and may your blade stay sharp and your spells potent. Let the adventure begin. 

Disclaimer: ChatGTP was used to edit this post for clarity

Sunday, May 12, 2019

Ivanti Service Manager and PowerShell? Oh YEAH!

I discovered the excellent PSHEATAPI a few months ago. Ever since then whenever I have had a spare minute I have been poking around inside the API interface in our ISM tenant.

It wasn't long until I had a light bulb moment. Where I finally truly appreciated how well designed mature Enterprise software can be. Unlocking this API is a game changer for us.

Let me give some background. I was an early adopter of PowerShell. Over the last decade, I've enjoyed building tools that people in my teams have been able to use to streamline their work and make life easier.

I always faced the problem of not being able to put those tools in front of our normal user base. 4 years ago I knuckled down and learnt MVC and c# so I could do that. I built some rudimentary web interfaces that wrote back to a SQL database then read from that database in PowerShell to initiate automation scripts.

This never really gained traction beyond the first few that I built because it simply took too long and was quite labour-intensive. So time to market for new features was too long and it was never really worth investing in.

That all changed when I realised ISM and its request offering module could be called from a simple PowerShell script.

That was my lightbulb moment! When I realised the service management platform could serve as the user interface. While it could also be the backend and a system of record so we know who did what when!

Over the past couple of months, I've been building out a simple framework. The idea is to make it quick and easy to create a form in Ivanti Service Manager that our users can enter values into. Then pull that form from PowerShell and feed user input into some self-service automation script.

Well, it's built now and running 8 service requests in production.  Our time to market for a new self-service feature is now about an hour, down from 1 to 2 weeks. Making self-service features a great time investment.

I'm really excited about this. I don't know if this is old territory for a lot of people. The combination seems really obvious now that I'm looking at it. If it's not already in widespread use in large IT shops this or something like it will be soon.

If you're already a customer of Ivanti service manager in the Cloud and have a large Library of PowerShell scripts you should have a look at this. You don't have to do it the way we're doing it here. But if you only take one thing away from reading this. Let It Be the knowledge that;

It is now ridiculously easy to build enterprise-grade self-service applications.

A copy of the framework is available on GitHub. https://github.com/benhaslett/OhBe

Monday, June 5, 2017

Everyday Powershell - Part 43 - Automatically Resume Failed HyperV Replication

Everyday Powershell, as useful as HyperV Replication.

So on our 2012R2 HyperV boxes we occasionally get problems with replication. Usually after a Windows Update related reboot.


So we could go through each of the VMs failed Replications, right click, resume replication but what are we? Barbarians?!?

We've scheduled the following script  to run on our hypervisors;

$hypervisor = "someserver"

$vms = Get-VMReplication -ComputerName $hypervisor | where health -eq "critical" | where state -ne replicating | where name -ne "someservertoexclude"

foreach($vm in $vms){
    while((Get-VM -ComputerName $hypervisor -VMName $vm.name | where ReplicationState -ne "disabled" | get-vmReplication).state -ne "Replicating"){
        $vm.name
        (get-VM -ComputerName $hypervisor -VMName $vm.name | where ReplicationState -ne "disabled" | get-vmReplication).state
        if ((get-VM -ComputerName $hypervisor -VMName $vm.name | where ReplicationState -ne "disabled" | get-vmReplication).state -ne "Resynchronizing"){
            get-vm $vm.name -ComputerName $hypervisor | Resume-VMReplication -Resynchronize
            get-vm $vm.name -ComputerName $hypervisor | Resume-VMReplication -Continue
            get-vm $vm.name -ComputerName $hypervisor | Resume-VMReplication
            get-vm $vm.name -ComputerName $hypervisor | get-VMReplication
        }
        start-sleep -Seconds 10
    }
}

get-vm -ComputerName $hypervisor | where health -eq "warning" | foreach-object {Reset-VMReplicationStatistics $_.name}

So now when replication goes to hell because of a reboot, all the VMs just politley get back in line and do as they're told!

Friday, May 5, 2017

Everyday Powershell - Part 42 - Creating and populating Groups

Everyday Powershell, as useful as a loosely typed variable. In that sometime it's great others it can ruin your day!

So we're following on from last time where we learned the resolution of all the monitors we could talk to.

Now we're going to do something with that data.
import-csv C:\temp\monitoraudit.csv | where pcon -eq $true | where ScreenWidth -ne "" | ForEach-Object{
    $temp = "" | select pc, resolutionstring
    $temp.pc = $_.computername
    $temp.resolutionstring = ("PCs with screens at " + $_.ScreenWidth + "x" + $_.ScreenHeight)
    $temp
    $test = $null
    $test = get-adgroup $temp.resolutionstring
    if($test -eq $null){
        New-ADGroup -GroupScope DomainLocal -Name $temp.resolutionstring
    }
    Add-ADGroupMember $temp.resolutionstring -Members (get-adcomputer $temp.pc)
}
 
We use another foreach-object to jump over each row in our CSV
  • setup another temp object 
  • fill the temp object if useful information, PC name and a string with the resolution
  • we check if an AD group with the name of our string exists
  • if it doesn't we create the group
  • then we add the PC Name to the AD group
So what can we do with this? Well it's really useful to had AD groups with all your machines resolutions. You can;
  • See who management likes
  • Create interesting reports on which monitors should be replaced
  • Use the groups to apply policies to
The last one is what we're doing this for. We'll use these groups to target customised wallpapers, screen savers and login screens.