Category: News
How do I plot an empty circle with no values in the middle of meshgrid plot3
Hi everyone.
Bascially I am tracking the depth of a surface using grids. x,y coordinates and z for depth. To fill the voids in between grids, I am using meshgrid with natural interpolation. However I have placed a circular piece in the middle of the grid hence on a plot3 it is supposed to be a white circular figue. How do I make sure this is drawn correctly because the image I attached does not look correct. Also how do I make sure that the meshgrid interpolates around the shape of the circle in the middle? This the code I have currently.
x = data(:,1); y = data(:,2); z = data(:,3)
x = table2array(x); y = table2array(y); z = table2array(z)
xlin = linspace(min(x), max(x), 100);
ylin = linspace(min(y), max(y), 100);
[X,Y] = meshgrid(xlin, ylin);
Z = griddata(x,y,z,X,Y,’natural’);
% Z = griddata(x,y,z,X,Y,’cubic’);
% Z = griddata(x,y,z,X,Y,’v4′);
mesh(X,Y,Z)
axis tight; hold on
plot3(x,y,z,’.’,’MarkerSize’,15)Hi everyone.
Bascially I am tracking the depth of a surface using grids. x,y coordinates and z for depth. To fill the voids in between grids, I am using meshgrid with natural interpolation. However I have placed a circular piece in the middle of the grid hence on a plot3 it is supposed to be a white circular figue. How do I make sure this is drawn correctly because the image I attached does not look correct. Also how do I make sure that the meshgrid interpolates around the shape of the circle in the middle? This the code I have currently.
x = data(:,1); y = data(:,2); z = data(:,3)
x = table2array(x); y = table2array(y); z = table2array(z)
xlin = linspace(min(x), max(x), 100);
ylin = linspace(min(y), max(y), 100);
[X,Y] = meshgrid(xlin, ylin);
Z = griddata(x,y,z,X,Y,’natural’);
% Z = griddata(x,y,z,X,Y,’cubic’);
% Z = griddata(x,y,z,X,Y,’v4′);
mesh(X,Y,Z)
axis tight; hold on
plot3(x,y,z,’.’,’MarkerSize’,15) Hi everyone.
Bascially I am tracking the depth of a surface using grids. x,y coordinates and z for depth. To fill the voids in between grids, I am using meshgrid with natural interpolation. However I have placed a circular piece in the middle of the grid hence on a plot3 it is supposed to be a white circular figue. How do I make sure this is drawn correctly because the image I attached does not look correct. Also how do I make sure that the meshgrid interpolates around the shape of the circle in the middle? This the code I have currently.
x = data(:,1); y = data(:,2); z = data(:,3)
x = table2array(x); y = table2array(y); z = table2array(z)
xlin = linspace(min(x), max(x), 100);
ylin = linspace(min(y), max(y), 100);
[X,Y] = meshgrid(xlin, ylin);
Z = griddata(x,y,z,X,Y,’natural’);
% Z = griddata(x,y,z,X,Y,’cubic’);
% Z = griddata(x,y,z,X,Y,’v4′);
mesh(X,Y,Z)
axis tight; hold on
plot3(x,y,z,’.’,’MarkerSize’,15) meshgrid, plot3 MATLAB Answers — New Questions
Help understanding how function handle is used
So I had an extremely helpful replier in an earlier question given me an equation for an interpolation function (I didn’t know about the floor and ceil function which would’ve answered my question and given me the opportunity to try writting the interpolation function myself, but I’m not going to look a gift horse in the mouth)
function fitness = interFt(Ft, x, j, k, t)
% Find the floor and ceiling for j and k
j_floor = floor(j);
j_ceil = ceil(j);
k_floor = floor(k);
k_ceil = ceil(k);
% Calculate probabilities based on the distance from the actual values
p_j_floor = j_ceil – j;
p_j_ceil = j – j_floor;
p_k_floor = k_ceil – k;
p_k_ceil = k – k_floor;
% Calculate the weighted fitness for each combination
fitness = 0;
fitness = fitness + p_j_floor * p_k_floor * Ft(x, j_floor, k_floor, t);
fitness = fitness + p_j_floor * p_k_ceil * Ft(x, j_floor, k_ceil, t);
fitness = fitness + p_j_ceil * p_k_floor * Ft(x, j_ceil, k_floor, t);
fitness = fitness + p_j_ceil * p_k_ceil * Ft(x, j_ceil, k_ceil, t);
end
They also gave me an example of how to use the function, but they used a function handle and i’m not sure how it’s being used
for tt=19:-1:1
for i=1:15
for j=1:15
for k=1:15
% here is a snipet of my code that I’m using with one of the
% examples of how I’m using the InterFt function; it’s set up
% exactly how the replier showed
state1 = interFt(@(x,j,k,t) Ft(x,j,k,t), xp(i),zp(j),yy(k),tt+1);
end
end
end
end
Why is Ft not included in the @()?
Why is it that when I change the x’s to i’s it messes things up (while also changing the x to an i in the written function)?
I know you’re not supposed to include the entire code, but let me know if that’s needed to see what I mean
Here is the link to the original question: https://www.mathworks.com/matlabcentral/answers/2119211-creating-a-function-for-linear-interpolation-based-on-two-changing-states?s_tid=srchtitle
[[I have a lot of code that I think has something wrong with it, and I think has to do with the states, but I’m not sure how I need to "fix" it]]So I had an extremely helpful replier in an earlier question given me an equation for an interpolation function (I didn’t know about the floor and ceil function which would’ve answered my question and given me the opportunity to try writting the interpolation function myself, but I’m not going to look a gift horse in the mouth)
function fitness = interFt(Ft, x, j, k, t)
% Find the floor and ceiling for j and k
j_floor = floor(j);
j_ceil = ceil(j);
k_floor = floor(k);
k_ceil = ceil(k);
% Calculate probabilities based on the distance from the actual values
p_j_floor = j_ceil – j;
p_j_ceil = j – j_floor;
p_k_floor = k_ceil – k;
p_k_ceil = k – k_floor;
% Calculate the weighted fitness for each combination
fitness = 0;
fitness = fitness + p_j_floor * p_k_floor * Ft(x, j_floor, k_floor, t);
fitness = fitness + p_j_floor * p_k_ceil * Ft(x, j_floor, k_ceil, t);
fitness = fitness + p_j_ceil * p_k_floor * Ft(x, j_ceil, k_floor, t);
fitness = fitness + p_j_ceil * p_k_ceil * Ft(x, j_ceil, k_ceil, t);
end
They also gave me an example of how to use the function, but they used a function handle and i’m not sure how it’s being used
for tt=19:-1:1
for i=1:15
for j=1:15
for k=1:15
% here is a snipet of my code that I’m using with one of the
% examples of how I’m using the InterFt function; it’s set up
% exactly how the replier showed
state1 = interFt(@(x,j,k,t) Ft(x,j,k,t), xp(i),zp(j),yy(k),tt+1);
end
end
end
end
Why is Ft not included in the @()?
Why is it that when I change the x’s to i’s it messes things up (while also changing the x to an i in the written function)?
I know you’re not supposed to include the entire code, but let me know if that’s needed to see what I mean
Here is the link to the original question: https://www.mathworks.com/matlabcentral/answers/2119211-creating-a-function-for-linear-interpolation-based-on-two-changing-states?s_tid=srchtitle
[[I have a lot of code that I think has something wrong with it, and I think has to do with the states, but I’m not sure how I need to "fix" it]] So I had an extremely helpful replier in an earlier question given me an equation for an interpolation function (I didn’t know about the floor and ceil function which would’ve answered my question and given me the opportunity to try writting the interpolation function myself, but I’m not going to look a gift horse in the mouth)
function fitness = interFt(Ft, x, j, k, t)
% Find the floor and ceiling for j and k
j_floor = floor(j);
j_ceil = ceil(j);
k_floor = floor(k);
k_ceil = ceil(k);
% Calculate probabilities based on the distance from the actual values
p_j_floor = j_ceil – j;
p_j_ceil = j – j_floor;
p_k_floor = k_ceil – k;
p_k_ceil = k – k_floor;
% Calculate the weighted fitness for each combination
fitness = 0;
fitness = fitness + p_j_floor * p_k_floor * Ft(x, j_floor, k_floor, t);
fitness = fitness + p_j_floor * p_k_ceil * Ft(x, j_floor, k_ceil, t);
fitness = fitness + p_j_ceil * p_k_floor * Ft(x, j_ceil, k_floor, t);
fitness = fitness + p_j_ceil * p_k_ceil * Ft(x, j_ceil, k_ceil, t);
end
They also gave me an example of how to use the function, but they used a function handle and i’m not sure how it’s being used
for tt=19:-1:1
for i=1:15
for j=1:15
for k=1:15
% here is a snipet of my code that I’m using with one of the
% examples of how I’m using the InterFt function; it’s set up
% exactly how the replier showed
state1 = interFt(@(x,j,k,t) Ft(x,j,k,t), xp(i),zp(j),yy(k),tt+1);
end
end
end
end
Why is Ft not included in the @()?
Why is it that when I change the x’s to i’s it messes things up (while also changing the x to an i in the written function)?
I know you’re not supposed to include the entire code, but let me know if that’s needed to see what I mean
Here is the link to the original question: https://www.mathworks.com/matlabcentral/answers/2119211-creating-a-function-for-linear-interpolation-based-on-two-changing-states?s_tid=srchtitle
[[I have a lot of code that I think has something wrong with it, and I think has to do with the states, but I’m not sure how I need to "fix" it]] interpolation, function handle MATLAB Answers — New Questions
How to generate Generic VHDL from simulink for sysgen model?
I have used xilinx basic blocks to design a model. I wanted to generate generic VHDL without xilinx specific references. Eventhough i have choosen Behavioural HDL for implementation generated vhdl consist of xilinx specific DFlip-Flop and SRLUTs. Kindly let me know if there is a way? if the option is not being applied then how can we write a matlab sript to set automatically without doing it manually?I have used xilinx basic blocks to design a model. I wanted to generate generic VHDL without xilinx specific references. Eventhough i have choosen Behavioural HDL for implementation generated vhdl consist of xilinx specific DFlip-Flop and SRLUTs. Kindly let me know if there is a way? if the option is not being applied then how can we write a matlab sript to set automatically without doing it manually? I have used xilinx basic blocks to design a model. I wanted to generate generic VHDL without xilinx specific references. Eventhough i have choosen Behavioural HDL for implementation generated vhdl consist of xilinx specific DFlip-Flop and SRLUTs. Kindly let me know if there is a way? if the option is not being applied then how can we write a matlab sript to set automatically without doing it manually? systemgenerator, vhdl, matlab, xilinx, simulink MATLAB Answers — New Questions
How do I solve this error?: Matrix out of range for deletion
Can someone help me to figure out why I am out of range for deletion with this? This code was first used with data that had multiple values in the matrix (i.e. "carbclay" was a matrix with 4 values), but now I’m only doing it with one value, so maybe that’s why it’s not working? I have gotten a lot of help with this so I don’t quite understand it fully, forgive my lack of knowledge when it comes to calling things the right name, hope someone can understand what’s wrong:( The goal of the code is to be able to leave off legend entries if any of the data that I want to plot is missing from my table.
carbclay=[rocktypes(1)]; missingdata1=[];
np = 0;
hp = [];
legtxt = {};
i = find(string(TAllData.gen_rock_type)==carbclay);
if any([sum(isnan(TAllData.a_b(i)))==length(i),sum(isnan(TAllData.temp(i)))==length(i)])
missingdata1=[missingdata1,i];
else hp(end+1) = scatter(TAllData.temp(i),TAllData.a_b(i),120,c1,’filled’,’o’,’MarkerFaceAlpha’,0.7);
legtxt{end+1} = carbclay{1};
end
carbclay(missingdata1)=”; %The error happens here for some reason, and then the legend does not show up
legend(hp,legtxt,’Location’,’northeastoutside’);
Error Message:
Matrix index is out of range for deletion.
Error in ScriptForPlots_RFD (line 1507)
carbclay(missingdata1)=”;Can someone help me to figure out why I am out of range for deletion with this? This code was first used with data that had multiple values in the matrix (i.e. "carbclay" was a matrix with 4 values), but now I’m only doing it with one value, so maybe that’s why it’s not working? I have gotten a lot of help with this so I don’t quite understand it fully, forgive my lack of knowledge when it comes to calling things the right name, hope someone can understand what’s wrong:( The goal of the code is to be able to leave off legend entries if any of the data that I want to plot is missing from my table.
carbclay=[rocktypes(1)]; missingdata1=[];
np = 0;
hp = [];
legtxt = {};
i = find(string(TAllData.gen_rock_type)==carbclay);
if any([sum(isnan(TAllData.a_b(i)))==length(i),sum(isnan(TAllData.temp(i)))==length(i)])
missingdata1=[missingdata1,i];
else hp(end+1) = scatter(TAllData.temp(i),TAllData.a_b(i),120,c1,’filled’,’o’,’MarkerFaceAlpha’,0.7);
legtxt{end+1} = carbclay{1};
end
carbclay(missingdata1)=”; %The error happens here for some reason, and then the legend does not show up
legend(hp,legtxt,’Location’,’northeastoutside’);
Error Message:
Matrix index is out of range for deletion.
Error in ScriptForPlots_RFD (line 1507)
carbclay(missingdata1)=”; Can someone help me to figure out why I am out of range for deletion with this? This code was first used with data that had multiple values in the matrix (i.e. "carbclay" was a matrix with 4 values), but now I’m only doing it with one value, so maybe that’s why it’s not working? I have gotten a lot of help with this so I don’t quite understand it fully, forgive my lack of knowledge when it comes to calling things the right name, hope someone can understand what’s wrong:( The goal of the code is to be able to leave off legend entries if any of the data that I want to plot is missing from my table.
carbclay=[rocktypes(1)]; missingdata1=[];
np = 0;
hp = [];
legtxt = {};
i = find(string(TAllData.gen_rock_type)==carbclay);
if any([sum(isnan(TAllData.a_b(i)))==length(i),sum(isnan(TAllData.temp(i)))==length(i)])
missingdata1=[missingdata1,i];
else hp(end+1) = scatter(TAllData.temp(i),TAllData.a_b(i),120,c1,’filled’,’o’,’MarkerFaceAlpha’,0.7);
legtxt{end+1} = carbclay{1};
end
carbclay(missingdata1)=”; %The error happens here for some reason, and then the legend does not show up
legend(hp,legtxt,’Location’,’northeastoutside’);
Error Message:
Matrix index is out of range for deletion.
Error in ScriptForPlots_RFD (line 1507)
carbclay(missingdata1)=”; matrix, table, legend MATLAB Answers — New Questions
Seasonal decomposition of a daily time series
I have a time series that contains daily variation from 2015 to 2023. I want to see the trend, seasonal components and unmodelled part. Kindly help. The time series has veen attachedI have a time series that contains daily variation from 2015 to 2023. I want to see the trend, seasonal components and unmodelled part. Kindly help. The time series has veen attached I have a time series that contains daily variation from 2015 to 2023. I want to see the trend, seasonal components and unmodelled part. Kindly help. The time series has veen attached time series analysis, seasonal adjustment, seasonal decomposition MATLAB Answers — New Questions
Outlook contact business cards partially covered by black bars
The Microsoft agent on the Microsoft Outlook Community Forum suggested I cross-post the issue here so it can be fixed.
Please see the full discussion at: https://answers.microsoft.com/en-us/outlook_com/forum/outlk_win-outtop_classic-outsub_ofh/outlook-contact-business-cards-partially-covered/0386d601-1193-435e-801a-68392cf8b7c6?messageId=f6e3b6f5-863c-4450-87d8-cb272dd9c139
Here is a copy:
For many years, though several versions of Outlook for Windows and on multiple machines running everything from Windows 7 through Windows 11, I’ve been putting up with big black bars covering the bottom parts of many of my contacts’ business cards. This never happens with the contacts at the top of my list, but it always happens with the contacts near the bottom. (I have ~5,000 contacts, and the bars start to appear as I scroll down past the 2,500 mark or so.)
Some are worse than others:
Here’s the overall view near the end of the alphabet. Notice that some rows of business cards have thicker bars than others, but as you scroll down further in the alphabet, all rows get the bars. (Ignore the grey boxes. I added those to obscure the details. It’s the black boxes that I’m talking about. They’re what I see.)
It never happens near the top of the alphabet:
This has been reported by many other users over the years, but never solved:
…and…
…and elsewhere.
I’ve tried all of the various suggestions about disabling animations and hardware acceleration, but nothing works. And since I’ve observed this on multiple systems with different graphics cards, different monitors, different OSs, different Office versions, and both laptops and desktops, I have to assume this is an inherent Office bug that has something to do with very long contact lists in the business card view.
I’m running Microsoft® Outlook® 2019 MSO (Version 2406 Build 16.0.17726.20078) 64-bit on Windows 11 Pro 64-bit, but as I wrote above, I’ve had the same problem as far back as Windows 7 or 8 and Office 2010 or 2013.
From the discussion on the Community Forum, it became clear that scaling the contact cards at or below 85% (Contacts > View > View Settings > Other Settings… > Card size %) and restarting Outlook makes the black bars go away, but then the cards are too small to be useful. It also was confirmed there that effect is currently visible and reproducible across at least two users and platforms. So, this is some kind of a scaling issue, and it’s a bug.
Can this be fixed?
Thank you.
The Microsoft agent on the Microsoft Outlook Community Forum suggested I cross-post the issue here so it can be fixed. Please see the full discussion at: https://answers.microsoft.com/en-us/outlook_com/forum/outlk_win-outtop_classic-outsub_ofh/outlook-contact-business-cards-partially-covered/0386d601-1193-435e-801a-68392cf8b7c6?messageId=f6e3b6f5-863c-4450-87d8-cb272dd9c139 Here is a copy: For many years, though several versions of Outlook for Windows and on multiple machines running everything from Windows 7 through Windows 11, I’ve been putting up with big black bars covering the bottom parts of many of my contacts’ business cards. This never happens with the contacts at the top of my list, but it always happens with the contacts near the bottom. (I have ~5,000 contacts, and the bars start to appear as I scroll down past the 2,500 mark or so.) Some are worse than others: Here’s the overall view near the end of the alphabet. Notice that some rows of business cards have thicker bars than others, but as you scroll down further in the alphabet, all rows get the bars. (Ignore the grey boxes. I added those to obscure the details. It’s the black boxes that I’m talking about. They’re what I see.) It never happens near the top of the alphabet: This has been reported by many other users over the years, but never solved:https://answers.microsoft.com/en-us/outlook_com/forum/all/outlook-contacts-black-line/efaf4d45-98cd-48ec-95a9-d9c40ebb0978…and…https://answers.microsoft.com/en-us/outlook_com/forum/all/busines-card-view-corruption-in-outlook-2016-64/6195cb49-a461-4aaa-b233-511aa4d5fb4f…and elsewhere. I’ve tried all of the various suggestions about disabling animations and hardware acceleration, but nothing works. And since I’ve observed this on multiple systems with different graphics cards, different monitors, different OSs, different Office versions, and both laptops and desktops, I have to assume this is an inherent Office bug that has something to do with very long contact lists in the business card view. I’m running Microsoft® Outlook® 2019 MSO (Version 2406 Build 16.0.17726.20078) 64-bit on Windows 11 Pro 64-bit, but as I wrote above, I’ve had the same problem as far back as Windows 7 or 8 and Office 2010 or 2013. From the discussion on the Community Forum, it became clear that scaling the contact cards at or below 85% (Contacts > View > View Settings > Other Settings… > Card size %) and restarting Outlook makes the black bars go away, but then the cards are too small to be useful. It also was confirmed there that effect is currently visible and reproducible across at least two users and platforms. So, this is some kind of a scaling issue, and it’s a bug.Can this be fixed? Thank you. Read More
Storage Account Private Endpoint with Compute Gallery
Hopefully this is the right group to pose this question. I have a Compute Gallery with some VM Applications in it. I have the Storage Account with the blobs configured with a Private Endpoint. When I try to turn off Public Network Access, the VM Apps in the Gallery no longer function, citing access issues.
I’m assuming the Compute Gallery won’t access my Storage Account over a Private Link inside my vNET, so my question is how do I lock down the Storage Account to not have things wide open? Is there specific IPs that the Compute Gallery will use when accessing the Storage Account?
Hopefully this is the right group to pose this question. I have a Compute Gallery with some VM Applications in it. I have the Storage Account with the blobs configured with a Private Endpoint. When I try to turn off Public Network Access, the VM Apps in the Gallery no longer function, citing access issues.I’m assuming the Compute Gallery won’t access my Storage Account over a Private Link inside my vNET, so my question is how do I lock down the Storage Account to not have things wide open? Is there specific IPs that the Compute Gallery will use when accessing the Storage Account? Read More
OneNote Web App Text Box width
When using OneNote Web app and pasting in a block of text, the text box is created about 2 feet wide, scrolling off the screen to the right. If you scroll over to the right edge and try to resize the box by dragging it to the left, then the text itself, which was its original width, gets severely narrowed to the point it is unusable.
To Reproduce, paste this block (or any similar) of text into OneNote web app, then notice the width of the text box and try to resize it:
Why attack surface reduction rules are important
Your organization’s attack surface includes all the places where an attacker could compromise your organization’s devices or networks. Reducing your attack surface means protecting your organization’s devices and network, which leaves attackers with fewer ways to perform attacks. Configuring attack surface reduction rules in Microsoft Defender for Endpoint can help!
Attack surface reduction rules target certain software behaviors, such as:
Launching executable files and scripts that attempt to download or run filesRunning obfuscated or otherwise suspicious scriptsPerforming behaviors that apps don’t usually initiate during normal day-to-day work
Such software behaviors are sometimes seen in legitimate applications. However, these behaviors are often considered risky because they’re commonly abused by attackers through malware. Attack surface reduction rules can constrain software-based risky behaviors and help keep your organization safe.
For a sequential, end-to-end process of how to manage attack surface reduction rules, see:
Attack surface reduction rules deployment overviewPlan attack surface reduction rules deploymentTest attack surface reduction rulesEnable attack surface reduction rulesOperationalize attack surface reduction rules
When using OneNote Web app and pasting in a block of text, the text box is created about 2 feet wide, scrolling off the screen to the right. If you scroll over to the right edge and try to resize the box by dragging it to the left, then the text itself, which was its original width, gets severely narrowed to the point it is unusable. To Reproduce, paste this block (or any similar) of text into OneNote web app, then notice the width of the text box and try to resize it: Why attack surface reduction rules are importantYour organization’s attack surface includes all the places where an attacker could compromise your organization’s devices or networks. Reducing your attack surface means protecting your organization’s devices and network, which leaves attackers with fewer ways to perform attacks. Configuring attack surface reduction rules in Microsoft Defender for Endpoint can help!Attack surface reduction rules target certain software behaviors, such as:Launching executable files and scripts that attempt to download or run filesRunning obfuscated or otherwise suspicious scriptsPerforming behaviors that apps don’t usually initiate during normal day-to-day workSuch software behaviors are sometimes seen in legitimate applications. However, these behaviors are often considered risky because they’re commonly abused by attackers through malware. Attack surface reduction rules can constrain software-based risky behaviors and help keep your organization safe.For a sequential, end-to-end process of how to manage attack surface reduction rules, see:Attack surface reduction rules deployment overviewPlan attack surface reduction rules deploymentTest attack surface reduction rulesEnable attack surface reduction rulesOperationalize attack surface reduction rules Read More
How to view 2 weeks in new calendar
This was so easy in the old calendar. All I did was hold the CTRL button and highlight the days I needed to view, I would then be able to see 2 weeks on my screen and all the details of each day within that 2 week timeframe. I have tried everything in the new outlook and cannot figure out how to do this. Please help??? (This is a key feature I use for my business)
This was so easy in the old calendar. All I did was hold the CTRL button and highlight the days I needed to view, I would then be able to see 2 weeks on my screen and all the details of each day within that 2 week timeframe. I have tried everything in the new outlook and cannot figure out how to do this. Please help??? (This is a key feature I use for my business) Read More
Recover Multiple VMs from Azure Backup in Less Time
In the dynamic world of cloud computing, time is often a critical factor, especially when it comes to recovering from disasters like ransomware attacks or rolling back after a problematic security update. Imagine waking up to find your entire set of Azure VMs compromised by ransomware or discovering that a recent security update has left your systems inoperable. The clock starts ticking, and the longer it takes to restore your VMs, the greater the impact on your business.
The Problem
Azure Backup is a robust solution for protecting your Azure VMs, providing peace of mind with its ability to create and manage backup policies, configure backup schedules, and perform reliable restores. However, the features available for Azure Backup in the Portal UI today only allow the restoration of individual VMs one at a time. Restoring many VMs manually through the Azure Portal can be extremely time-consuming and inefficient, especially when you need to restore an entire set of VMs quickly.
Native Capabilities of Azure Backup
Azure Backup offers extensive features for protecting your VMs:
Automated backup schedules and retention policies – A backup policy can protect multiple Azure VMs consisting of a schedule (daily/weekly) and retention (daily, weekly, monthly, yearly).
Cross-region restore capabilities – Allows you to restore data in a secondary, Azure paired region. This can be useful to conduct BCDR drills or if there’s a disaster in the primary region.
Ransomware protection – Features such as irreversible soft-delete, immutable storage and multi-user authorization can be set at the vault level to safeguard backup data.
Despite these powerful features, there is always room for improvement. For now, there is currently no functionality in the Azure Portal to batch restore multiple VMs simultaneously. This limitation becomes a bottleneck in scenarios where speed and efficiency are paramount.
Az PowerShell Module – A Good Solution
To address this gap, we turn to PowerShell scripting, a versatile and powerful tool for managing Azure resources. Microsoft’s Az PowerShell module provides a comprehensive suite of cmdlets to automate and manage Azure tasks, including VM backups and restores.
Here’s a practical approach: a PowerShell script that enables the parallel restoration of multiple VMs from Azure Backup. This script leverages Az.RecoveryServices to streamline the recovery process, significantly reducing the time required to get your systems back online.
Sample PowerShell Script
Below is a summary of how one example script works. You can find the full example here.
Define Variables:
The script starts by defining the necessary variables, including the resource group, recovery services vault, and cache storage account.
$resourceGroup = “rg-webservers”
$recoveryServicesVault = “rsv-vmbackup”
$cacheStorageAccount = “unique626872”
$cacheStorageAccountResourceGroup = “rg-webservers”
Get the Vault and Backup Container:
It then retrieves the Recovery Services Vault and Backup Container containing multiple VMs that need to be restored in parallel.
$vault = Get-AzRecoveryServicesVault -ResourceGroupName $resourceGroup -Name $recoveryServicesVault
$container = Get-AzRecoveryServicesBackupContainer -ContainerType “AzureVM” -VaultId $vault.ID
Loop Through the Backup Items:
The script iterates over each backup item in the container, performing a shutdown and kicking off an in-place restore from the latest recovery points.
foreach ($item in $container) {
# Get the Backup Item from the Vault
$backupItem = Get-AzRecoveryServicesBackupItem -BackupManagementType “AzureVM” -WorkloadType “AzureVM” -VaultId $vault.ID -Name $item.Name
# Get the resource group & VM name for this backupItem
$vmResourceGroup = $backupItem.VirtualMachineId.Split(‘/’)[4]
$vmName = $backupItem.VirtualMachineId.Split(‘/’)[8]
# Shut down the protected VM before restoring it
Stop-AzVM -ResourceGroupName $vmResourceGroup -Name $vmName -Force -SkipShutdown -NoWait
# Get the latest recovery point for the backup item from the last 7 days
$recoveryPoints = Get-AzRecoveryServicesBackupRecoveryPoint -Item $backupItem -VaultId $vault.ID -StartDate (Get-Date).AddDays(-7).ToUniversalTime() -EndDate (Get-Date).ToUniversalTime()
# Restore the Azure VM from the latest recovery point to the original location (replace the source VM)
$OriginalLocationRestoreJob = Restore-AzRecoveryServicesBackupItem -RecoveryPoint $recoveryPoints[0] -StorageAccountName $cacheStorageAccount -StorageAccountResourceGroupName $cacheStorageAccountResourceGroup -VaultId $vault.ID -VaultLocation $vault.Location
}
By using this script, you can dramatically reduce the time required to restore multiple VMs, enhancing your ability to recover from critical incidents swiftly.
Conclusion
In this post, we’ve discussed the limitations in the Azure Portal for handling multiple VM restores and introduced a practical workaround using PowerShell scripting. This solution enables you to restore your VMs in parallel, significantly cutting down recovery time and minimizing business disruption.
We encourage you to modify the sample script, try it out in your test environment and see the benefits for yourself. Your feedback is invaluable, so please share your experiences and let us know your thoughts on this approach. Together, we can continue to improve and innovate in the realm of Azure Business Continuity.
Call to Action
Modify the sample script and try it out in your test environment for parallel VM restoration.
Share your feedback and experiences with us.
Stay tuned for more tips and tricks on maximizing your Azure capabilities.
Happy scripting, and may your recoveries be swift and seamless!
Microsoft Tech Community – Latest Blogs –Read More
Please explain the maths behind calculating lateral deviation
Please explain me the maths behind the lateral deviation used in many exmples.
Curvature unit is m-1 and if we multiply by logitudinal velocity (m/s), we get s-1 which is rate of change / frequency. How are we subrating Yaw rate by it?
And how are we getting e1 from u3*u2 + u1?Please explain me the maths behind the lateral deviation used in many exmples.
Curvature unit is m-1 and if we multiply by logitudinal velocity (m/s), we get s-1 which is rate of change / frequency. How are we subrating Yaw rate by it?
And how are we getting e1 from u3*u2 + u1? Please explain me the maths behind the lateral deviation used in many exmples.
Curvature unit is m-1 and if we multiply by logitudinal velocity (m/s), we get s-1 which is rate of change / frequency. How are we subrating Yaw rate by it?
And how are we getting e1 from u3*u2 + u1? model predictive control toolbox, vehicle dynamics, trajectories, path planning MATLAB Answers — New Questions
Invalid expression during a function handle
I am recieving the following error:
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
This is the line that is causing the error:
Kernel = @x q.*(exp(-jk.*(sqrt(a^2 + (m1 – (x)).^2)))./(4*pi.*((sqrt(a^2 + (m1 – (x)).^2)).^5)))*((1+jk.*(sqrt(a^2 + (m1 – (x)).^2))).*(2*((sqrt(a^2 + (m1 – (x)).^2)).^2)-3.*(a^2))+((k*a.*(sqrt(a^2 + (m1 – (x)).^2))).^2));
The following variables have already been defined prior to this line:
q, jk, m1, k and a. The only variable is x.
I counted the parentheses, checked the multiplication operator, and I am not trying to construct a matrix.
Some background context:
This line is within 2 for loops. When I take off the function handle (@x) and set x = 1, the code runs without any errors. I plan on integrating this Kernel function and pass it to an array. The original equation is q*(exp(-jk*R)/(4*pi*(R^5)))*((1+jk*R)*(2*(R^2)-3*(a^2))+((k*a*R)^2)) but since the variable X is within R, I expanded R at each instance. R = sqrt(a^2 + (m1 – m2)^2)
Thank you guys in advance!I am recieving the following error:
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
This is the line that is causing the error:
Kernel = @x q.*(exp(-jk.*(sqrt(a^2 + (m1 – (x)).^2)))./(4*pi.*((sqrt(a^2 + (m1 – (x)).^2)).^5)))*((1+jk.*(sqrt(a^2 + (m1 – (x)).^2))).*(2*((sqrt(a^2 + (m1 – (x)).^2)).^2)-3.*(a^2))+((k*a.*(sqrt(a^2 + (m1 – (x)).^2))).^2));
The following variables have already been defined prior to this line:
q, jk, m1, k and a. The only variable is x.
I counted the parentheses, checked the multiplication operator, and I am not trying to construct a matrix.
Some background context:
This line is within 2 for loops. When I take off the function handle (@x) and set x = 1, the code runs without any errors. I plan on integrating this Kernel function and pass it to an array. The original equation is q*(exp(-jk*R)/(4*pi*(R^5)))*((1+jk*R)*(2*(R^2)-3*(a^2))+((k*a*R)^2)) but since the variable X is within R, I expanded R at each instance. R = sqrt(a^2 + (m1 – m2)^2)
Thank you guys in advance! I am recieving the following error:
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
This is the line that is causing the error:
Kernel = @x q.*(exp(-jk.*(sqrt(a^2 + (m1 – (x)).^2)))./(4*pi.*((sqrt(a^2 + (m1 – (x)).^2)).^5)))*((1+jk.*(sqrt(a^2 + (m1 – (x)).^2))).*(2*((sqrt(a^2 + (m1 – (x)).^2)).^2)-3.*(a^2))+((k*a.*(sqrt(a^2 + (m1 – (x)).^2))).^2));
The following variables have already been defined prior to this line:
q, jk, m1, k and a. The only variable is x.
I counted the parentheses, checked the multiplication operator, and I am not trying to construct a matrix.
Some background context:
This line is within 2 for loops. When I take off the function handle (@x) and set x = 1, the code runs without any errors. I plan on integrating this Kernel function and pass it to an array. The original equation is q*(exp(-jk*R)/(4*pi*(R^5)))*((1+jk*R)*(2*(R^2)-3*(a^2))+((k*a*R)^2)) but since the variable X is within R, I expanded R at each instance. R = sqrt(a^2 + (m1 – m2)^2)
Thank you guys in advance! function, matlab function, integral MATLAB Answers — New Questions
Vlookup, Index, Match
Excel idiot here…..
In the pic below, on the sheet on the right, I am choosing two values in columns E and F from validation (reference the sheet on the left) and would like to return a value from a sheet on the left. i.e. If I choose “ELDC” and “OT Rate” on the right, I would like choose the proper value from the table on the left…in this case $31.76. Any help is appreciated!!!
Excel idiot here…..In the pic below, on the sheet on the right, I am choosing two values in columns E and F from validation (reference the sheet on the left) and would like to return a value from a sheet on the left. i.e. If I choose “ELDC” and “OT Rate” on the right, I would like choose the proper value from the table on the left…in this case $31.76. Any help is appreciated!!! Read More
Is it possible to cleanly decommission Windows CA?
So, I have a pain point I am currently dealing with. I joined the company I am with after the AD environment had already been established. There was a fair amount of turnover before I joined and part of that was that the previous System Admins were not thorough with documentation and they did things on a whim. To that, when I joined the PDC was also a CA that, as far as I could tell, was not actively being used by any systems other than the DCs to issue certs. The running theory is that the previous system admins were planning to use CA to do 802.1x type security for Wifi and VPN but never got around to completing the setup.
Obviously, it was not great that they installed the CA role onto the PDC. But I have since corrected that. I was able to extract the CA role and migrate it to a different server and I can see that it is able to issues certs to the DCs. (Looks like it has only issued Kerberos Authentication, DC Authentication, and Directory Email Replication certs since being migrated, and only on DCs). However, I don’t want the CA role around at all because it is one more server we have to maintain and we are not using it in any meaningful way.
I know there is documentation on how to actually decommission a CA from the network (How to decommission a Windows enterprise certification authority and remove all related objects ) but my question is; should/can I decommission it? Throughout my career, every time I have talked to another System Admin or gone through any training, I have always heard that I need to be extremely careful when deciding to add a CA role to a windows network. Because once it is established and issuing certs, it becomes next to impossible to fully/safely remove. Is that the case? Has anyone successfully removed a CA from their windows domain without breaking everything?
So, I have a pain point I am currently dealing with. I joined the company I am with after the AD environment had already been established. There was a fair amount of turnover before I joined and part of that was that the previous System Admins were not thorough with documentation and they did things on a whim. To that, when I joined the PDC was also a CA that, as far as I could tell, was not actively being used by any systems other than the DCs to issue certs. The running theory is that the previous system admins were planning to use CA to do 802.1x type security for Wifi and VPN but never got around to completing the setup. Obviously, it was not great that they installed the CA role onto the PDC. But I have since corrected that. I was able to extract the CA role and migrate it to a different server and I can see that it is able to issues certs to the DCs. (Looks like it has only issued Kerberos Authentication, DC Authentication, and Directory Email Replication certs since being migrated, and only on DCs). However, I don’t want the CA role around at all because it is one more server we have to maintain and we are not using it in any meaningful way. I know there is documentation on how to actually decommission a CA from the network (How to decommission a Windows enterprise certification authority and remove all related objects ) but my question is; should/can I decommission it? Throughout my career, every time I have talked to another System Admin or gone through any training, I have always heard that I need to be extremely careful when deciding to add a CA role to a windows network. Because once it is established and issuing certs, it becomes next to impossible to fully/safely remove. Is that the case? Has anyone successfully removed a CA from their windows domain without breaking everything? Read More
Need Ability to Force Native Resolution on Remote Desktop HTML5 Web Client
Hello,
Not sure if this forum is also for the HTML 5 RD web client but if so, I’d like to request a feature or ask if there’s a way to force the clients to use native resolution. We can force it to use web (vs .RDP) and suppress telemetry but not the native resolution slider. I tried a few DWORDS in HKLMSoftwareMicrosoftRemoteDesktopWeb but no luck.
When we roll this out to hundreds of users, they’ll all have to check that box. Would be nice if we could force it on the admin side with a reg key or the Set-RDWebClientDeploymentSetting cmdlet.
thanks,
Dan
Hello, Not sure if this forum is also for the HTML 5 RD web client but if so, I’d like to request a feature or ask if there’s a way to force the clients to use native resolution. We can force it to use web (vs .RDP) and suppress telemetry but not the native resolution slider. I tried a few DWORDS in HKLMSoftwareMicrosoftRemoteDesktopWeb but no luck. When we roll this out to hundreds of users, they’ll all have to check that box. Would be nice if we could force it on the admin side with a reg key or the Set-RDWebClientDeploymentSetting cmdlet. thanks,Dan Read More
Formula trouble
I want to do this thing, but I have no idea where to start or what type of formulas to try:
I’m tracking evaluations in my company
Column E is the type of evaluation: Initial F, and Initial E.
Column G is the date their evaluation process was initiated
Column H is the date their evaluation process closes out.
People designated “Initial F” in column E have a close out date (Column H) that is 60 days after their initiation date (Column G)
People designated “Initial E” in column E have a close out date (Column H) that is 45 days after their initiation date (Column G)
I want column H to automatically generate a date that is respectively, 45 or 60 days after the date in column G based on the condition in column E.
I want to do this thing, but I have no idea where to start or what type of formulas to try:I’m tracking evaluations in my company Column E is the type of evaluation: Initial F, and Initial E. Column G is the date their evaluation process was initiatedColumn H is the date their evaluation process closes out. People designated “Initial F” in column E have a close out date (Column H) that is 60 days after their initiation date (Column G)People designated “Initial E” in column E have a close out date (Column H) that is 45 days after their initiation date (Column G) I want column H to automatically generate a date that is respectively, 45 or 60 days after the date in column G based on the condition in column E. Read More
Bookings Emails Deleting automatically
I am an IT admin for Bookings at our organization. One of our staff members noticed her Bookings meeting confirmations are automatically directed to her trash. I assume this is because the meeting invite is accepted automatically on her behalf. Unfortunately, pertinent information is on those emails (such as notes and customer responses). We have tried to make mailbox rules as well as toggle “ignored” emails off but to no avail. Please advise.
I am an IT admin for Bookings at our organization. One of our staff members noticed her Bookings meeting confirmations are automatically directed to her trash. I assume this is because the meeting invite is accepted automatically on her behalf. Unfortunately, pertinent information is on those emails (such as notes and customer responses). We have tried to make mailbox rules as well as toggle “ignored” emails off but to no avail. Please advise. Read More
Formula to autofill a PO #
I have a workbook with 2 sheets.
Sheet 1, column A is where the formula needs to go – based off the information in the sheet called Customer list.
Example: Customer List – Column A is customer name – Column B is the PO# Starting String. This is specific to the customer.
I want to open Sheet 1 and type a customer name in B2 and a PO number automatically fill in based off the criteria mentioned above. So if my Customer name is Asset Living (on sheet: Customer List – A2) and I type Asset Living in Sheet 1, B2, the the PO# that populates in Sheet 1 A2 should be AL(from Customer List, B2) followed by random numbers (preferrably 3 digits).
I have a workbook with 2 sheets.Sheet 1, column A is where the formula needs to go – based off the information in the sheet called Customer list.Example: Customer List – Column A is customer name – Column B is the PO# Starting String. This is specific to the customer.I want to open Sheet 1 and type a customer name in B2 and a PO number automatically fill in based off the criteria mentioned above. So if my Customer name is Asset Living (on sheet: Customer List – A2) and I type Asset Living in Sheet 1, B2, the the PO# that populates in Sheet 1 A2 should be AL(from Customer List, B2) followed by random numbers (preferrably 3 digits). Read More
xlookup with table issue
Hello!
I am working on a file that requires use of xlookup. to keep things organized and for ease of reviewal, i use the table headers in the formulas (instead of just column letter). I realized that my formulas are not working properly. when I set the formula up, it only seems to return the value that appears first in the lookup array.
For example, I am trying to find and return three different things: call them A, B, and C. In the table that I am doing the lookup from, if A, B, and C are listed in that order, then my lookups will only have one that works, and it will return A. During trouble shooting, I deleted the rows that had A and B, leaving only C. Once I did this, the C was the first lookup value in the lookup table, and the formula worked (it returned C). This informs me that it is not an error of difference of spelling / spaces / etc. in lookup value and items in lookup array.
Also during troubleshooting, I used the column letters as opposed to the table header names in the formula, and it worked perfect.
Has anyone experienced this before / does anyone have any tips???
Hello! I am working on a file that requires use of xlookup. to keep things organized and for ease of reviewal, i use the table headers in the formulas (instead of just column letter). I realized that my formulas are not working properly. when I set the formula up, it only seems to return the value that appears first in the lookup array. For example, I am trying to find and return three different things: call them A, B, and C. In the table that I am doing the lookup from, if A, B, and C are listed in that order, then my lookups will only have one that works, and it will return A. During trouble shooting, I deleted the rows that had A and B, leaving only C. Once I did this, the C was the first lookup value in the lookup table, and the formula worked (it returned C). This informs me that it is not an error of difference of spelling / spaces / etc. in lookup value and items in lookup array. Also during troubleshooting, I used the column letters as opposed to the table header names in the formula, and it worked perfect. Has anyone experienced this before / does anyone have any tips??? Read More